public class FileBasedRandomInputView extends AbstractPagedInputView implements SeekableDataInputView, Closeable
SeekableDataInputView
to read bytes from RandomAccessFile
, the bytes can be
cached to MemorySegment
s in CacheManager
.Constructor and Description |
---|
FileBasedRandomInputView(PageFileInput input,
CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected int |
getLimitForSegment(MemorySegment segment)
Gets the limit for reading bytes from the given memory segment.
|
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, doAdvance, 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 FileBasedRandomInputView(PageFileInput input, CacheManager cacheManager)
public void setReadPosition(long position)
SeekableDataInputView
setReadPosition
in interface SeekableDataInputView
position
- The new read position.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.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.