public class AsciiLineReader extends Object implements LineReader, LocationAware
readLine() functionality around a PositionalBufferedStream
BufferedReader and its BufferedReader.readLine() method should be used in preference to this class (when the
LocationAware functionality is not required) because it offers greater performance.| Constructor and Description |
|---|
AsciiLineReader(InputStream is) |
AsciiLineReader(PositionalBufferedStream is) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getPosition()
The current offset, in bytes, of this stream/writer/file.
|
static void |
main(String[] args) |
String |
readLine()
Same as
readLine(PositionalBufferedStream) but uses the stream provided in the constructor |
String |
readLine(PositionalBufferedStream stream)
Read a line of text.
|
public AsciiLineReader(InputStream is)
public AsciiLineReader(PositionalBufferedStream is)
public long getPosition()
LocationAwaregetPosition in interface LocationAwarepublic final String readLine(PositionalBufferedStream stream) throws IOException
stream - the stream to read the next line fromIOExceptionpublic final String readLine() throws IOException
readLine(PositionalBufferedStream) but uses the stream provided in the constructorreadLine in interface LineReaderIOExceptionpublic void close()
close in interface LineReaderclose in interface Closeableclose in interface AutoCloseable