K
Krmathieu
I am working on an application that creates a buffer from a random access file
using the BufferedReader class. I have been able to create the buffer from the
input file and read/then print the first line from the buffer by using the
BufferedReader class method of readLine(). However, I can not find a method
that would enable me to read in the next line. I have included the relevant
code from my app below:
fileName = fileChooser.getSelectedFile();
input = new RandomAccessFile( fileName, "r" );
fileReader = new FileReader( fileName.getName() );
bufferedReader = new BufferedReader ( fileReader );
String line = bufferedReader.readLine();
Does anybody know what method or code could be used to access the next line
of the buffer? Basically, what I am trying to do is read in each individual
line of a file, assign the line to a string variable and then check to see if
the string contains the start of a valid subject. Also, I tried resetting the
starting mark of the read from the buffer by using the reset() method of the
BufferedClass, but I got a compile error stating that the compiler could not
resolve the symbol of reset() even though I have included java.io.* as an
import statement. Any help that anybody could provide would be greatly
appreciated. Thanks.
Kevin
using the BufferedReader class. I have been able to create the buffer from the
input file and read/then print the first line from the buffer by using the
BufferedReader class method of readLine(). However, I can not find a method
that would enable me to read in the next line. I have included the relevant
code from my app below:
fileName = fileChooser.getSelectedFile();
input = new RandomAccessFile( fileName, "r" );
fileReader = new FileReader( fileName.getName() );
bufferedReader = new BufferedReader ( fileReader );
String line = bufferedReader.readLine();
Does anybody know what method or code could be used to access the next line
of the buffer? Basically, what I am trying to do is read in each individual
line of a file, assign the line to a string variable and then check to see if
the string contains the start of a valid subject. Also, I tried resetting the
starting mark of the read from the buffer by using the reset() method of the
BufferedClass, but I got a compile error stating that the compiler could not
resolve the symbol of reset() even though I have included java.io.* as an
import statement. Any help that anybody could provide would be greatly
appreciated. Thanks.
Kevin