Java Utililty Methods FileReader Create

List of utility methods to do FileReader Create

Description

The list of methods to do FileReader Create are organized into topic(s).

Method

ListreadTextFileAsList(File file)
Read text file as String
List<String> lines = new ArrayList<String>();
BufferedReader reader = new BufferedReader(new FileReader(file));
String temp = null;
try {
    while ((temp = reader.readLine()) != null) {
        lines.add(temp);
} finally {
...
StringreadTextFileContents(File fFile)
Reads the text file contents and returns it as a string.
if (fFile == null) {
    throw new NullPointerException("File is null.");
Reader rReader = null;
try {
    rReader = new FileReader(fFile);
    return readReaderContents(rReader);
} finally {
...
StringreadTextFileFully(File file)
Will skip lines starting with //
BufferedReader reader = null;
try {
    reader = new BufferedReader(new FileReader(file));
    StringBuilder buffer = new StringBuilder();
    String line = null;
    while ((line = reader.readLine()) != null) {
        if (!line.startsWith("//")) {
            buffer.append(line).append('\n');
...
ArrayListreadTextFileLines(String fullPathFilename)
read Text File Lines
ArrayList<String> datas = new ArrayList();
StringBuilder sb = new StringBuilder(1024);
BufferedReader reader = new BufferedReader(new FileReader(fullPathFilename));
char[] chars = new char[1024];
String s;
while ((s = reader.readLine()) != null) {
    datas.add(s);
reader.close();
return datas;