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()
LocationAware
getPosition
in interface LocationAware
public final String readLine(PositionalBufferedStream stream) throws IOException
stream
- the stream to read the next line fromIOException
public final String readLine() throws IOException
readLine(PositionalBufferedStream)
but uses the stream provided in the constructorreadLine
in interface LineReader
IOException
public void close()
close
in interface LineReader
close
in interface Closeable
close
in interface AutoCloseable