public class AsciiLineReader extends java.lang.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(java.io.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(java.lang.String[] args) |
java.lang.String |
readLine()
Same as
readLine(PositionalBufferedStream) but uses the stream provided in the constructor |
java.lang.String |
readLine(PositionalBufferedStream stream)
Read a line of text.
|
public AsciiLineReader(java.io.InputStream is)
public AsciiLineReader(PositionalBufferedStream is)
public long getPosition()
LocationAwaregetPosition in interface LocationAwarepublic final java.lang.String readLine(PositionalBufferedStream stream) throws java.io.IOException
stream - the stream to read the next line fromjava.io.IOExceptionpublic final java.lang.String readLine()
throws java.io.IOException
readLine(PositionalBufferedStream) but uses the stream provided in the constructorreadLine in interface LineReaderjava.io.IOExceptionpublic void close()
close in interface LineReaderclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception