Package org.apache.flink.core.memory
Interface DataInputView
-
- All Superinterfaces:
DataInput
- All Known Subinterfaces:
SeekableDataInputView
- All Known Implementing Classes:
AbstractChannelReaderInputView
,AbstractPagedInputView
,BinaryHashPartition
,ChannelReaderInputView
,CompressedHeaderlessChannelReaderInputView
,DataInputDeserializer
,DataInputViewStreamWrapper
,FileChannelInputView
,HashPartition
,HeaderlessChannelReaderInputView
,LongHashPartition
,RandomAccessInputView
,ReOpenableHashPartition
,SeekableFileChannelInputView
@Public public interface DataInputView extends DataInput
This interface defines a view over some memory that can be used to sequentially read the contents of the memory. The view is typically backed by one or moreMemorySegment
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
read(byte[] b)
Tries to fill the given byte arrayb
.int
read(byte[] b, int off, int len)
Reads up tolen
bytes of memory and stores it intob
starting at offsetoff
.void
skipBytesToRead(int numBytes)
SkipsnumBytes
bytes of memory.-
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
-
-
-
-
Method Detail
-
skipBytesToRead
void skipBytesToRead(int numBytes) throws IOException
SkipsnumBytes
bytes of memory. In contrast to theDataInput.skipBytes(int)
method, this method always skips the desired number of bytes or throws anEOFException
.- Parameters:
numBytes
- The number of bytes to skip.- Throws:
IOException
- Thrown, if any I/O related problem occurred such that the input could not be advanced to the desired position.
-
read
int read(byte[] b, int off, int len) throws IOException
Reads up tolen
bytes of memory and stores it intob
starting at offsetoff
.If
len
is zero, then no bytes are read and0
is returned; otherwise, there is an attempt to read at least one byte. If there is no more data left, the value-1
is returned; otherwise, at least one byte is read and stored intob
.- Parameters:
b
- byte array to store the data tooff
- offset into byte arraylen
- byte length to read- Returns:
- the number of actually read bytes of -1 if there is no more data left
- Throws:
IOException
-
read
int read(byte[] b) throws IOException
Tries to fill the given byte arrayb
. Returns the actually number of read bytes or -1 if there is no more data.- Parameters:
b
- byte array to store the data to- Returns:
- the number of read bytes or -1 if there is no more data left
- Throws:
IOException
-
-