LocationAware
, LineReader
, Closeable
, AutoCloseable
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.Modifier | Constructor | Description |
---|---|---|
protected |
AsciiLineReader() |
|
|
AsciiLineReader(PositionalBufferedStream is) |
Deprecated.
8/8/2017 use
from(java.io.InputStream) |
|
AsciiLineReader(InputStream is) |
Deprecated.
8/8/2017 use
from(java.io.InputStream) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
static AsciiLineReader |
from(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.
|
String |
readLine() |
Same as
readLine(PositionalBufferedStream) but uses the stream provided in the constructor |
String |
readLine(PositionalBufferedStream stream) |
Deprecated.
8/8/2017 use
from(java.io.InputStream) to create a new AsciiLineReader and readLine() |
String |
toString() |
protected AsciiLineReader()
@Deprecated public AsciiLineReader(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(InputStream inputStream)
inputStream
- An InputStream-derived class that implements BlockCompressedInputStream or PositionalBufferedStreampublic long getPosition()
LocationAware
getPosition
in interface LocationAware
public int getLineTerminatorLength()
@Deprecated public String readLine(PositionalBufferedStream stream) throws IOException
from(java.io.InputStream)
to create a new AsciiLineReader and readLine()
stream
- the stream to read the next line fromIOException
public String readLine() throws IOException
readLine(PositionalBufferedStream)
but uses the stream provided in the constructorreadLine
in interface LineReader
IOException
public void close()
close
in interface AutoCloseable
close
in interface Closeable
close
in interface LineReader