2 * Tests read from a file that uses buffering directly, thereby eliminating the read method calls
3 * to read number of rows from an input txt file
5 public class TestreadFromFile {
6 public static void main(String[] args) {
8 int MAX_LINE_LENGTH = 1000000; /* max input is 400000 one digit input + spaces */
10 filename = "input/random-n2048-d16-c16.txt";
11 FileInputStream inputFile = new FileInputStream(filename);
12 byte buf[] = new byte[MAX_LINE_LENGTH];
14 while ((n = inputFile.read(buf)) != 0) {
15 for (int i = 0; i < n; i++) {
21 System.out.println("numRows= " +numRows);
27 * ../buildscript TestreadFromFile.java -mainclass TestreadFromFile -o TestreadFromFile