Interface Block

All Superinterfaces:
AutoCloseable, org.aksw.commons.io.util.channel.ChannelFactory<Seekable>, Segment
All Known Subinterfaces:
Page
All Known Implementing Classes:
PageBase

public interface Block extends Segment
A block is a sub-sequence of bytes with a fixed finite length which however may be initially unknown, and thus has a certain horizon of explored length. A block's full length can at any time be requested, hence a Block is a subclass of Segment. A block has an offset value into the sequence that contains the block. For example, a block may backed by a bz2 decoding input stream, and only if the stream hits the end, we know how much data there is actually in the block.
Author:
raven
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Offset in a parent container; should be 0 if there is none
    boolean
    Check if there is a subsequent block.
    boolean
     
    Ref<? extends Block>
    The block source of this block - if any.
    Ref<? extends Block>
     

    Methods inherited from interface java.lang.AutoCloseable

    close

    Methods inherited from interface org.aksw.commons.io.util.channel.ChannelFactory

    newChannel

    Methods inherited from interface org.aksw.commons.io.block.api.Segment

    length
  • Method Details

    • getOffset

      long getOffset()
      Offset in a parent container; should be 0 if there is none
      Returns:
    • nextBlock

      Ref<? extends Block> nextBlock() throws IOException
      The block source of this block - if any.
      Returns:
      the block source or null if there is none
      Throws:
      IOException
    • prevBlock

      Ref<? extends Block> prevBlock() throws IOException
      Throws:
      IOException
    • hasNext

      boolean hasNext() throws IOException
      Check if there is a subsequent block.
      Returns:
      Throws:
      IOException
    • hasPrev

      boolean hasPrev() throws IOException
      Throws:
      IOException