Package org.nd4j.linalg.compression
Class CompressionDescriptor
- java.lang.Object
-
- org.nd4j.linalg.compression.CompressionDescriptor
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class CompressionDescriptor extends Object implements Cloneable, Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
COMPRESSION_BYTE_BUFFER_LENGTH
-
Constructor Summary
Constructors Constructor Description CompressionDescriptor()
CompressionDescriptor(DataBuffer buffer)
Create a compression descriptor from the given data buffer elementsCompressionDescriptor(DataBuffer buffer, String algorithm)
Initialize a compression descriptor based on the given algorithm and data bufferCompressionDescriptor(DataBuffer buffer, NDArrayCompressor compressor)
Initialize a compression descriptor based on the given data buffer (for the sizes) and the compressor to get the opType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CompressionDescriptor
clone()
static CompressionDescriptor
fromByteBuffer(ByteBuffer byteBuffer)
Instantiate a compression descriptor from the given bytebufferByteBuffer
toByteBuffer()
Return a direct allocated bytebuffer from the compression codec.
-
-
-
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 ofalgorithm
- 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
-
clone
public CompressionDescriptor clone()
-
-