Class CompressedBlockReader

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public final class CompressedBlockReader
    extends Object
    implements Closeable
    Reader for a virtual contiguous address range backed by compressed blocks of data. Format: | version (byte) | compression (byte) | block size (int) | num blocks (int) | end offsets | compressed data | This mechanism supports two modes of use, the first where callers may ask for a range of data from the underlying blocks, provided by getRange(long, int). The ByteBuffer provided by this method may or may not be valid after additional calls to getRange(long, int) or calls to seekBlock(int). For fixed width values which are aligned with the block size, callers may also use the method getDecompressedDataBuffer() to have direct access to the current uncompressed block, and use the methods loadBlock(long) to load the correct block and translate a virtual offset into the relative offset, or seekBlock(int) to change which block is currently loaded. getRange(long, int) uses these same mechanisms internally to supply data.
    See Also:
    for writer