Class CompressionDescriptor

    • Field Detail

      • COMPRESSION_BYTE_BUFFER_LENGTH

        public static final int COMPRESSION_BYTE_BUFFER_LENGTH
        See Also:
        Constant Field Values
    • Constructor Detail

      • CompressionDescriptor

        public CompressionDescriptor()
      • CompressionDescriptor

        public CompressionDescriptor​(DataBuffer buffer)
        Create a compression descriptor from the given data buffer elements
        Parameters:
        buffer - the databuffer to create the compression descriptor from
      • CompressionDescriptor

        public CompressionDescriptor​(DataBuffer buffer,
                                     String algorithm)
        Initialize a compression descriptor based on the given algorithm and data buffer
        Parameters:
        buffer - the data buffer to base the sizes off of
        algorithm - the algorithm used in the descriptor
      • CompressionDescriptor

        public CompressionDescriptor​(DataBuffer buffer,
                                     NDArrayCompressor compressor)
        Initialize a compression descriptor based on the given data buffer (for the sizes) and the compressor to get the opType
        Parameters:
        buffer -
        compressor -
    • Method Detail

      • fromByteBuffer

        public static CompressionDescriptor fromByteBuffer​(ByteBuffer byteBuffer)
        Instantiate a compression descriptor from the given bytebuffer
        Parameters:
        byteBuffer - the bytebuffer to instantiate the descriptor from
        Returns:
        the instantiated descriptor based on the given bytebuffer
      • toByteBuffer

        public ByteBuffer toByteBuffer()
        Return a direct allocated bytebuffer from the compression codec. The size of the bytebuffer is calculated to be: 40: 8 + 32 two ints representing their enum values for the compression algorithm and opType and 4 longs for the compressed and original sizes
        Returns:
        the bytebuffer described above