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.| Modifier | Constructor and Description |
|---|---|
protected |
AsciiLineReader() |
|
AsciiLineReader(java.io.InputStream is)
Deprecated.
8/8/2017 use
from(java.io.InputStream) |
|
AsciiLineReader(PositionalBufferedStream is)
Deprecated.
8/8/2017 use
from(java.io.InputStream) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static AsciiLineReader |
from(java.io.InputStream inputStream)
Create an AsciiLineReader of the appropriate type for a given InputStream.
|
int |
getLineTerminatorLength()
Returns the length of the line terminator read after the last read line.
|
long |
getPosition()
The current offset, in bytes, of this stream/writer/file.
|
java.lang.String |
readLine()
Same as
readLine(PositionalBufferedStream) but uses the stream provided in the constructor |
java.lang.String |
readLine(PositionalBufferedStream stream)
Deprecated.
8/8/2017 use
from(java.io.InputStream) to create a new AsciiLineReader and readLine() |
java.lang.String |
toString() |
protected AsciiLineReader()
@Deprecated public AsciiLineReader(java.io.InputStream is)
from(java.io.InputStream)@Deprecated public AsciiLineReader(PositionalBufferedStream is)
from(java.io.InputStream)is - the PositionalBufferedStream input stream to be wrappedpublic static AsciiLineReader from(java.io.InputStream inputStream)
inputStream - An InputStream-derived class that implements BlockCompressedInputStream or PositionalBufferedStreampublic long getPosition()
LocationAwaregetPosition in interface LocationAwarepublic int getLineTerminatorLength()
@Deprecated public java.lang.String readLine(PositionalBufferedStream stream) throws java.io.IOException
from(java.io.InputStream) to create a new AsciiLineReader and readLine()stream - the stream to read the next line fromjava.io.IOExceptionpublic 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 java.lang.String toString()
toString in class java.lang.Object