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()
LocationAware
getPosition
in interface LocationAware
public 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.IOException
public java.lang.String readLine() throws java.io.IOException
readLine(PositionalBufferedStream)
but uses the stream provided in the constructorreadLine
in interface LineReader
java.io.IOException
public void close()
close
in interface LineReader
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public java.lang.String toString()
toString
in class java.lang.Object