Android Utililty Methods UTF8 File Read

List of utility methods to do UTF8 File Read


The list of methods to do UTF8 File Read are organized into topic(s).


StringloadUTF8(File file)
load UTF
FileInputStream is = new FileInputStream(file);
try {
    byte[] buf = new byte[1024];
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    while (true) {
        int read =;
        if (read == -1)
ListloadUTF8LinesFromFile(File file)
load UTF Lines From File
InputStream is = new FileInputStream(file);
Scanner scanner = new Scanner(is, "UTF-8");
List<String> r = new ArrayList<String>();
while (scanner.hasNextLine())
return r;
StringreadFile(String fileName, String encoding)
read File
try {
    File adfile = new File(fileName);
    StringBuffer content = new StringBuffer();
    if (adfile.isFile() && adfile.exists()) {
        InputStreamReader read = new InputStreamReader(
                new FileInputStream(adfile), encoding);
        BufferedReader in = new BufferedReader(read);
        String line1;
StringreadFromFile(String fileName)
reads the contents of the file passed in and returns the content as a String.
StringBuilder sb = new StringBuilder();
FileInputStream fstream = new FileInputStream(fileName);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in,
String line;
while ((line = br.readLine()) != null) {