Java Utililty Methods BufferedReader Read

List of utility methods to do BufferedReader Read

Description

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

Method

voidloadPathPreferencesFromFile(File inputFile)
Loads the path preferences from a text file.
BufferedReader br = new BufferedReader(new FileReader(inputFile));
try {
    String line;
    while ((line = br.readLine()) != null) {
        line = line.trim();
        if (!line.equals("") && !line.startsWith("#")) {
} finally {
    br.close();
StringloadPrivateKeyFile(File privateKeyFile)
Reads in the private key verbatim from the private key file
BufferedReader in = new BufferedReader(new FileReader(privateKeyFile));
StringBuffer key_buf = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
    key_buf.append(line);
    key_buf.append('\n');
in.close();
...
StringloadQueryFromFile(String queryFile)
load Query From File
BufferedReader reader = new BufferedReader(new FileReader(queryFile));
StringBuffer sb = new StringBuffer();
String line;
while ((line = reader.readLine()) != null) {
    sb.append(line).append("\n");
reader.close();
return (sb.toString());
...
StringloadQueryNodeInfo(String input_file)
load Query Node Info
String cur_line = "";
int query_count = 0;
long[] query_nodes = null;
double[] query_weights = null;
double sum_weights = 0;
String query_str = "";
try {
    BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(input_file), "UTF8"));
...
BufferedReaderloadReaderFromClasspath(Class c, String filename)
"Transform" a file on the classpath into a BufferedReader
return new BufferedReader(new InputStreamReader(c.getClassLoader().getResourceAsStream(filename)));
ListloadReaderToList(Reader reader)
Reads text from an open reader into a list of strings, each containing one line of the file.
List<String> outList = new LinkedList<String>();
String line;
BufferedReader bufferedReader = new BufferedReader(reader);
while ((line = bufferedReader.readLine()) != null)
    outList.add(line);
return outList;
HashMaploadRealDataGraphFromEmbers(String fileName, String splitter)
load Real Data Graph From Embers
HashMap<String, Double> graph = new HashMap<String, Double>();
BufferedReader br = null;
try {
    String sCurrentLine;
    br = new BufferedReader(new FileReader(fileName));
    while ((sCurrentLine = br.readLine()) != null) {
        String[] str = sCurrentLine.split(splitter);
        String edgeName = str[0];
...
voidloadSentences(InputStream stream, List jsonSentences)
load Sentences
Preconditions.checkNotNull(jsonSentences);
BufferedReader br = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
try {
    String line = br.readLine();
    while (line != null) {
        line = line.trim();
        if (line.equals("") || line.charAt(0) == '#') {
            line = br.readLine();
...
StringloadSimpleTextFile(File file, int bufferSize)
get the content of the file
StringBuffer strBuffer = new StringBuffer();
BufferedReader in = new BufferedReader(new FileReader(file), bufferSize);
String tempStr = in.readLine();
strBuffer.append(tempStr);
while ((tempStr = in.readLine()) != null) {
    strBuffer.append("\n").append(tempStr);
in.close();
...
String[]loadSqlFile(String path)

This method return the sql scripts from the given sql file.

StringBuffer sb = new StringBuffer();
BufferedReader reader = new BufferedReader(new FileReader(path));
try {
    String line = reader.readLine();
    while (line != null) {
        line = line.trim();
        if (line.length() != 0 && !line.startsWith("--")) {
            sb.append(line);
...