Skip to content

Instantly share code, notes, and snippets.

@alexejVasko
Last active March 22, 2016 13:22
Show Gist options
  • Save alexejVasko/d0bc93013fc29264ee53 to your computer and use it in GitHub Desktop.
Save alexejVasko/d0bc93013fc29264ee53 to your computer and use it in GitHub Desktop.
package calculator;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class StringFileReader {
public static final String OUT_FILE_PATH = "./output.txt";
public static String FileReader(){
String fileLine = null;
BufferedReader reader = null;
try {
reader = new BufferedReader(
new FileReader(OUT_FILE_PATH));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
try {
fileLine = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
return fileLine;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment