接口 DataBlock
- 所有已知子接口:
CloseableDataBlock
public interface DataBlock
Provides read access to a block of data contained somewhere in a zip file.
- 从以下版本开始:
- 3.2.0
- 作者:
- Phillip Webb
-
方法概要
修饰符和类型方法说明default InputStream
Return thisDataBlock
as anInputStream
.int
read
(ByteBuffer dst, long pos) Read a sequence of bytes from this channel into the given buffer, starting at the given block position.default void
readFully
(ByteBuffer dst, long pos) Fully read a sequence of bytes from this channel into the given buffer, starting at the given block position and fillingremaining
bytes in the buffer.long
size()
Return the size of this block.
-
方法详细资料
-
size
Return the size of this block.- 返回:
- the block size
- 抛出:
IOException
- on I/O error
-
read
Read a sequence of bytes from this channel into the given buffer, starting at the given block position.- 参数:
dst
- the buffer into which bytes are to be transferredpos
- the position within the block at which the transfer is to begin- 返回:
- the number of bytes read, possibly zero, or
-1
if the given position is greater than or equal to the block size - 抛出:
IOException
- on I/O error- 另请参阅:
-
readFully
Fully read a sequence of bytes from this channel into the given buffer, starting at the given block position and fillingremaining
bytes in the buffer.- 参数:
dst
- the buffer into which bytes are to be transferredpos
- the position within the block at which the transfer is to begin- 抛出:
EOFException
- if an attempt is made to read past the end of the blockIOException
- on I/O error
-
asInputStream
Return thisDataBlock
as anInputStream
.- 返回:
- an
InputStream
to read the data block content - 抛出:
IOException
- on IO error
-