|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.fasterxml.sort.DataReader<byte[]>
com.fasterxml.sort.std.RawTextLineReader
public class RawTextLineReader
Efficient reader for data that consists of text lines, i.e. character data separated by one of standard line feeds (CR, LF or CR+LF). For efficiency no decoding is done
| Nested Class Summary | |
|---|---|
static class |
RawTextLineReader.Factory
|
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
RawTextLineReader(InputStream in)
|
|
| Method Summary | |
|---|---|
protected boolean |
_loadMore()
|
protected byte[] |
_readNextSlow(int start)
|
protected boolean |
_skipCR()
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public RawTextLineReader(InputStream in)
| Method Detail |
|---|
public static RawTextLineReader.Factory factory()
DataReader.
public void close()
throws IOException
DataReader
close in class DataReader<byte[]>IOExceptionpublic int estimateSizeInBytes(byte[] item)
DataReader
estimateSizeInBytes in class DataReader<byte[]>
public byte[] readNext()
throws IOException
DataReader
readNext in class DataReader<byte[]>IOException
protected final byte[] _readNextSlow(int start)
throws IOException
IOException
protected boolean _loadMore()
throws IOException
IOException
protected boolean _skipCR()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||