public class RawTextLineReader extends DataReader<byte[]>
| Modifier and Type | Class and Description |
|---|---|
static class |
RawTextLineReader.Factory |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_closed |
protected boolean |
_hadCR
Marker we set if the last line ended with a CR, since it
may be followed by a trailing LF as part of two-byte linefeed.
|
protected InputStream |
_in |
protected byte[] |
_inputBuffer |
protected int |
_inputEnd |
protected int |
_inputPtr |
protected ByteArrayOutputStream |
_tmpBytes |
protected static byte |
BYTE_CR |
protected static byte |
BYTE_LF |
| Constructor and Description |
|---|
RawTextLineReader(InputStream in) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
_loadMore() |
protected byte[] |
_readNextSlow(int start) |
protected boolean |
_skipLF() |
void |
close()
Method for closing the reader.
|
int |
estimateSizeInBytes(byte[] item)
Method that should estimate memory usage of given item, for purpose
of limiting amount of data kept in memory during pre-sorting phase.
|
static RawTextLineReader.Factory |
factory()
Convenience method for instantiating factory to create instances of
this
DataReader. |
byte[] |
readNext()
Method for reading the next data item; will return
null to indicate end of input, otherwise return a non-null
item.
|
protected static final byte BYTE_CR
protected static final byte BYTE_LF
protected final InputStream _in
protected boolean _closed
protected byte[] _inputBuffer
protected int _inputPtr
protected int _inputEnd
protected boolean _hadCR
protected ByteArrayOutputStream _tmpBytes
public RawTextLineReader(InputStream in)
public static RawTextLineReader.Factory factory()
DataReader.public void close()
throws IOException
DataReaderclose in class DataReader<byte[]>IOExceptionpublic int estimateSizeInBytes(byte[] item)
DataReaderestimateSizeInBytes in class DataReader<byte[]>public byte[] readNext()
throws IOException
DataReaderreadNext in class DataReader<byte[]>IOExceptionprotected final byte[] _readNextSlow(int start)
throws IOException
IOExceptionprotected boolean _loadMore()
throws IOException
IOExceptionprotected boolean _skipLF()
throws IOException
IOExceptionCopyright © 2012-2014 FasterXML. All Rights Reserved.