public class DecodedDataBlock extends Object implements Block
| Modifier and Type | Field and Description |
|---|---|
protected BlockSource |
blockSource |
protected long |
blockStart |
protected ChannelFactory<Seekable> |
channelFactory |
| Constructor and Description |
|---|
DecodedDataBlock(BlockSource blockSource,
long blockStart,
ChannelFactory<Seekable> channelFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getBlockStart() |
BlockSource |
getBufferSource() |
ChannelFactory<Seekable> |
getChannelFactory() |
long |
getOffset()
Offset in a parent container; should be 0 if there is none
|
boolean |
hasNext()
Check if there is a subsequent block.
|
boolean |
hasPrev() |
long |
length()
Retrieve the length of the segment
For segments that are based on encoded data this method may trigger a full read
|
Seekable |
newChannel() |
Reference<Block> |
nextBlock()
The block source of this block - if any.
|
Reference<Block> |
prevBlock() |
protected BlockSource blockSource
protected long blockStart
protected ChannelFactory<Seekable> channelFactory
public DecodedDataBlock(BlockSource blockSource, long blockStart, ChannelFactory<Seekable> channelFactory)
public boolean hasNext()
throws IOException
BlockhasNext in interface BlockIOExceptionpublic boolean hasPrev()
throws IOException
hasPrev in interface BlockIOExceptionpublic Reference<Block> nextBlock() throws IOException
BlocknextBlock in interface BlockIOExceptionpublic Reference<Block> prevBlock() throws IOException
prevBlock in interface BlockIOExceptionpublic long getOffset()
Blockpublic BlockSource getBufferSource()
public long getBlockStart()
public ChannelFactory<Seekable> getChannelFactory()
public Seekable newChannel()
newChannel in interface ChannelFactory<Seekable>public void close()
throws Exception
close in interface AutoCloseableExceptionpublic long length()
throws IOException
Segmentlength in interface SegmentIOExceptionCopyright © 2020. All rights reserved.