Class RANSNx16ExternalCompressor
java.lang.Object
htsjdk.samtools.cram.compression.ExternalCompressor
htsjdk.samtools.cram.compression.RANSNx16ExternalCompressor
CRAM external compressor that uses the rANS Nx16 entropy coder (CRAM 3.1).
Supports order-0, order-1, bit-packing, RLE, striping, and CAT modes via
flag combinations. Wraps shared
RANSNx16Encode and RANSNx16Decode
instances to avoid repeated allocation of large internal tables.-
Field Summary
Fields inherited from class ExternalCompressor
NO_COMPRESSION_ARG -
Constructor Summary
ConstructorsConstructorDescriptionRANSNx16ExternalCompressor(int flags, RANSNx16Encode ransEncode, RANSNx16Decode ransDecode) Create a rANS Nx16 compressor with the specified flag combination.RANSNx16ExternalCompressor(RANSNx16Encode ransEncode, RANSNx16Decode ransDecode) We use a shared RANS instance for all compressors. -
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
-
RANSNx16ExternalCompressor
We use a shared RANS instance for all compressors.- Parameters:
ransEncode-ransDecode-
-
RANSNx16ExternalCompressor
Create a rANS Nx16 compressor with the specified flag combination.- Parameters:
flags- bitmask of rANS Nx16 flags (order, pack, RLE, stripe, etc.)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
-