# Class RANSNx16Encode

java.lang.Object
htsjdk.samtools.cram.compression.rans.RANSEncode<RANSNx16Params>
htsjdk.samtools.cram.compression.rans.RANSNx16Encode

public class RANSNx16Encode extends RANSEncode<RANSNx16Params>
Encoder for the CRAM 3.1 rANSNx16 codec. Internal encoding uses byte[] with backwards-write to eliminate the O(N) reverse pass. Pack/RLE/Stripe preprocessing still bridges through ByteBuffer where CompressionUtils methods require it.

## Constructor Summary

Constructors
Constructor
Description
`RANSNx16Encode()`

## Method Summary

Modifier and Type
Method
Description
`byte[]`
`compress(byte[] input, RANSNx16Params ransNx16Params)`
Compress a byte array using the rANS Nx16 codec.

### Methods inherited from class RANSEncode

`buildSymsOrder0, buildSymsOrder1, getEncodingSymbols`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### RANSNx16Encode

public RANSNx16Encode()

## Method Details

### compress

public byte[] compress(byte[] input, RANSNx16Params ransNx16Params)
Compress a byte array using the rANS Nx16 codec. Applies the transformations specified by the params (PACK, RLE, STRIPE) as preprocessing, then encodes the result with Order-0 or Order-1 rANS using 4-way or 32-way interleaving.

Specified by:
  `compress` in class `RANSEncode<RANSNx16Params>`
Parameters:
  `input` - the data to compress
  `ransNx16Params` - encoding parameters specifying order, interleave width, and transformations
Returns:
  the compressed byte stream