1 package com.android.tests.basicjar2; 2 3 import java.io.BufferedReader; 4 import java.io.IOException; 5 import java.io.InputStream; 6 import java.io.InputStreamReader; 7 8 public class BasicJar2 { 9 getContent()10 public static String getContent() { 11 InputStream input = BasicJar2.class.getResourceAsStream("/com/android/tests/basicjar2/basicJar2.txt"); 12 if (input == null) { 13 return "FAILED TO FIND basicJar2.txt"; 14 } 15 16 BufferedReader reader = null; 17 try { 18 reader = new BufferedReader(new InputStreamReader(input, "UTF-8")); 19 20 return reader.readLine(); 21 } catch (IOException e) { 22 } finally { 23 if (reader != null) { 24 try { 25 reader.close(); 26 } catch (IOException e) { 27 } 28 } 29 } 30 31 return "FAILED TO READ CONTENT"; 32 } 33 }