Android Text File Read readFree(File file)

Here you can find the source of readFree(File file)

Description

read Free

Declaration

private static List<String> readFree(File file) throws IOException 

Method Source Code

//package com.java2s;
import java.io.BufferedReader;

import java.io.File;

import java.io.FileReader;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Main {
    private static List<String> readFree(File file) throws IOException {

        List<String> archive = new ArrayList<String>();

        BufferedReader reader = new BufferedReader(new FileReader(file));

        String s;// ww  w .  java2 s .c  o m

        do {
            s = reader.readLine();
            if (s != null) {
                archive.add(s);
            }
        } while (s != null);

        reader.close();

        return archive;
    }
}

Related

  1. readFile(String path)
  2. readFileAsString(File file)
  3. readFileAsString(File file, String charset)
  4. readFileAsString(String filename)
  5. readFileLineByLine(File file)
  6. readFromFile(File file)
  7. readFull(String path)
  8. readLines(String file)
  9. readStringFromClasspath(String path, Class c)