Class RANS4x8ExternalCompressor
java.lang.Object
htsjdk.samtools.cram.compression.ExternalCompressor
htsjdk.samtools.cram.compression.RANS4x8ExternalCompressor
CRAM external compressor that uses the rANS 4x8 entropy coder (CRAM 3.0).
Wraps shared
RANS4x8Encode and RANS4x8Decode instances to
avoid repeated allocation of large internal tables.-
Field Summary
Fields inherited from class ExternalCompressor
NO_COMPRESSION_ARG -
Constructor Summary
ConstructorsConstructorDescriptionRANS4x8ExternalCompressor(int order, RANS4x8Encode ransEncode, RANS4x8Decode ransDecode) Create a rANS 4x8 compressor with the specified order (as an integer).RANS4x8ExternalCompressor(RANS4x8Encode ransEncode, RANS4x8Decode ransDecode) We use a shared RANS instance for all compressors.RANS4x8ExternalCompressor(RANSParams.ORDER order, RANS4x8Encode ransEncode, RANS4x8Decode ransDecode) Create a rANS 4x8 compressor with the specified order. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]compress(byte[] data, CRAMCodecModelContext unused_contextModel) Compress the data using the codec-specific context model.booleaninthashCode()toString()byte[]uncompress(byte[] data) Decompress the data.Methods inherited from class ExternalCompressor
getCompressorForMethod, getMethod, setMethod
-
Constructor Details
-
RANS4x8ExternalCompressor
We use a shared RANS instance for all compressors.- Parameters:
ransEncode- ransEncoder to useransDecode- ransDecoder to use
-
RANS4x8ExternalCompressor
Create a rANS 4x8 compressor with the specified order (as an integer).- Parameters:
order- the rANS order (0 or 1)ransEncode- shared encoder instanceransDecode- shared decoder instance
-
RANS4x8ExternalCompressor
public RANS4x8ExternalCompressor(RANSParams.ORDER order, RANS4x8Encode ransEncode, RANS4x8Decode ransDecode) Create a rANS 4x8 compressor with the specified order.- Parameters:
order- the rANS order (ZERO or ONE)ransEncode- shared encoder instanceransDecode- shared decoder instance
-
-
Method Details
-
compress
Description copied from class:ExternalCompressorCompress the data using the codec-specific context model.- Specified by:
compressin classExternalCompressor- Parameters:
data- the data to compressunused_contextModel- the context model to use for compression; may be null- Returns:
- the compressed data
-
uncompress
public byte[] uncompress(byte[] data) Description copied from class:ExternalCompressorDecompress the data.- Specified by:
uncompressin classExternalCompressor- Parameters:
data- the compressed data- Returns:
- the decompressed data
-
toString
- Overrides:
toStringin classExternalCompressor
-
equals
- Overrides:
equalsin classExternalCompressor
-
hashCode
public int hashCode()- Overrides:
hashCodein classExternalCompressor
-