public class SplitInputStreamImpl extends BinaryReader implements SplitInputStream
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER
The default size for the read buffer, in bytes.
|
protected long |
splitEnd |
protected long |
splitStart |
absolutePosition, buffer, position, size, source| Constructor and Description |
|---|
SplitInputStreamImpl(InputStream source,
long startOffset,
long endOffset)
Create a new input stream for the specified split.
|
SplitInputStreamImpl(InputStream source,
long startOffset,
long endOffset,
int bufferSize)
Create a new input stream for the specified window.
|
| Modifier and Type | Method and Description |
|---|---|
long |
availableInSplit()
Gets the number of bytes remaining in the split.
|
protected int |
fillBuffer()
Fills the working buffer
|
boolean |
hasOverrun()
Indicates whether the reader has read past the
end of the split.
|
protected void |
moveToSplit() |
long |
overrunPastSplit()
Gets the number of bytes which have been read
beyond the end of the split.
|
boolean |
skipTo(byte[] bytes)
Advances the position of the stream to the first byte
after the specified pattern.
|
available, close, getAbsolutePosition, isEmpty, loadNextBuffer, mark, markSupported, read, read, read, readBase128Int, readBase128Long, readByte, readBytes, readChar, readChars, readDouble, readFloat, readInt, readLong, readSingleByteChars, readUnsignedBase128Int, readUnsignedBase128Long, reset, skip, skipBytes, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, readpublic static final int DEFAULT_BUFFER
protected final long splitStart
protected final long splitEnd
public SplitInputStreamImpl(InputStream source, long startOffset, long endOffset) throws IOException
DEFAULT_BUFFER.
The resulting stream will be positioned the beginning of
the window.
As I/O is buffered, it is neither necessary nor preferable to use a
BufferedInputStream as the source.
source - the stream providing the split datastartOffset - the position of the first byte in the window; this is relative
to the starting position of source.endOffset - the position of the last byte in the window, exclusive;
this is relative to the starting position of source.IOException - if errors occur opening the split data sourcepublic SplitInputStreamImpl(InputStream source, long startOffset, long endOffset, int bufferSize) throws IOException
As I/O is buffered, it is neither necessary nor preferable to use a
BufferedInputStream as the source.
source - the stream providing the split datastartOffset - the position of the first byte in the window; this is relative
to the starting position of source.endOffset - the position of the last byte in the window, exclusive;
this is relative to the starting position of source.bufferSize - the size of the I/O buffer to use for reads, in bytesIOException - if errors occur opening the split data sourceprotected void moveToSplit()
throws IOException
IOExceptionprotected int fillBuffer()
throws IOException
BinaryReaderfillBuffer in class BinaryReaderIOExceptionpublic long availableInSplit()
availableInSplit in interface SplitInputStream0.public long overrunPastSplit()
0.public boolean hasOverrun()
hasOverrun in interface SplitInputStreamtrue if all bytes in the split
has been read, false if any remain.public boolean skipTo(byte[] bytes)
throws IOException
bytes - the pattern to find in the streamfalse if end of data is reached,
true otherwise.IOException - if an I/O error occurs while
reading the streamCopyright © 2024 Actian Corporation. All rights reserved.