public class RandomAccessInputView extends AbstractPagedInputView implements SeekableDataInputView
AbstractPagedInputView to read pages in memory.| 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.
|
List<MemorySegment> |
segments() |
void |
setReadPosition(long position)
Sets the read pointer to the given position.
|
advance, clear, doAdvance, getCurrentPositionInSegment, getCurrentSegment, getCurrentSegmentLimit, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seekInput, skipBytes, skipBytesToReadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitread, read, skipBytesToReadreadBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytespublic RandomAccessInputView(ArrayList<MemorySegment> segments, int segmentSize)
public RandomAccessInputView(ArrayList<MemorySegment> segments, int segmentSize, int limitInLastSegment)
public void setReadPosition(long position)
SeekableDataInputViewsetReadPosition in interface SeekableDataInputViewposition - The new read position.public long getReadPosition()
protected MemorySegment nextSegment(MemorySegment current) throws EOFException
AbstractPagedInputViewEOFException.nextSegment in class AbstractPagedInputViewcurrent - 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)
AbstractPagedInputViewgetLimitForSegment in class AbstractPagedInputViewsegment - The segment to determine the limit for.public List<MemorySegment> segments()
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.