public class RandomAccessInputView extends AbstractPagedInputView implements SeekableDataInputView
headerLength
Constructor and Description |
---|
RandomAccessInputView(ArrayList<MemorySegment> segments,
int segmentSize) |
RandomAccessInputView(ArrayList<MemorySegment> segments,
int segmentSize,
int limitInLastSegment) |
Modifier and Type | Method and Description |
---|---|
protected int |
getLimitForSegment(MemorySegment segment)
Gets the limit for reading bytes from the given memory segment.
|
long |
getReadPosition() |
protected MemorySegment |
nextSegment(MemorySegment current)
The method by which concrete subclasses realize page crossing.
|
void |
setReadPosition(long position)
Sets the read pointer to the given position.
|
advance, clear, getCurrentPositionInSegment, getCurrentSegment, getCurrentSegmentLimit, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seekInput, skipBytes, skipBytesToRead
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
read, read, skipBytesToRead
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
public RandomAccessInputView(ArrayList<MemorySegment> segments, int segmentSize)
public RandomAccessInputView(ArrayList<MemorySegment> segments, int segmentSize, int limitInLastSegment)
public void setReadPosition(long position)
SeekableDataInputView
setReadPosition
in interface SeekableDataInputView
position
- The new read position.public long getReadPosition()
protected MemorySegment nextSegment(MemorySegment current) throws EOFException
AbstractPagedInputView
EOFException
.nextSegment
in class AbstractPagedInputView
current
- The current page that was read to its limit. May be null
, if this method is
invoked for the first time.null
. If the input is
exhausted, an EOFException
must be thrown instead.EOFException
- Thrown, if no further segment is available.protected int getLimitForSegment(MemorySegment segment)
AbstractPagedInputView
getLimitForSegment
in class AbstractPagedInputView
segment
- The segment to determine the limit for.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.