Class CachableBlockFile.BlockRead

    • Constructor Detail

      • BlockRead

        public BlockRead​(InputStream in,
                         long size)
    • Method Detail

      • getStream

        public DataInputStream getStream()
                                  throws IOException
        It is intended that the caller of this method will close the stream we also only intend that this be called once per BlockRead. This method is provide for methods up stream that expect to receive a DataInputStream object.
        Specified by:
        getStream in interface ABlockReader
        Throws:
        IOException
      • isIndexable

        public boolean isIndexable()
        Description copied from interface: ABlockReader
        An indexable block supports seeking, getting a position, and associating an arbitrary index with the block
        Specified by:
        isIndexable in interface ABlockReader
        Returns:
        true, if the block is indexable; otherwise false.
      • seek

        public void seek​(int position)
        Specified by:
        seek in interface ABlockReader
      • getPosition

        public int getPosition()
        Description copied from interface: ABlockReader
        Get the file position.
        Specified by:
        getPosition in interface ABlockReader
        Returns:
        the file position.
      • getBuffer

        public byte[] getBuffer()
        The byte array returned by this method is only for read optimizations, it should not be modified.
        Specified by:
        getBuffer in interface ABlockReader