public class FileChannelInputView extends AbstractPagedInputView
DataInputView
that is backed by a BlockChannelReader
,
making it effectively a data input stream. The view reads it data in blocks from the underlying channel.
The view can read data that has been written by a FileChannelOutputView
, or that was written in blocks
in another fashion.headerLength
Constructor and Description |
---|
FileChannelInputView(BlockChannelReader<MemorySegment> reader,
MemoryManager memManager,
List<MemorySegment> memory,
int sizeOfLastBlock) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
closeAndDelete() |
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.
|
advance, clear, getCurrentPositionInSegment, getCurrentSegment, getCurrentSegmentLimit, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seekInput, skipBytes, skipBytesToRead
public FileChannelInputView(BlockChannelReader<MemorySegment> reader, MemoryManager memManager, List<MemorySegment> memory, int sizeOfLastBlock) throws IOException
IOException
public void close() throws IOException
IOException
public void closeAndDelete() throws IOException
IOException
protected MemorySegment nextSegment(MemorySegment current) throws IOException
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.IOException
- Thrown, if the method cannot provide the next page due to an I/O related problem.protected int getLimitForSegment(MemorySegment segment)
AbstractPagedInputView
getLimitForSegment
in class AbstractPagedInputView
segment
- The segment to determine the limit for.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.