Class RangeEncode

java.lang.Object
htsjdk.samtools.cram.compression.range.RangeEncode

public class RangeEncode extends Object
Encoder for the CRAM 3.1 arithmetic (range) codec. This is an adaptive, byte-wise compression codec for use with data streams that have a varying byte/symbol probability distribution. Significantly more expensive than rAns.
  • Constructor Details

    • RangeEncode

      public RangeEncode()
  • Method Details

    • compress

      public ByteBuffer compress(ByteBuffer inBuffer, RangeParams rangeParams)
      Compress data using the CRAM 3.1 arithmetic (range) codec with the given parameters. The input buffer is consumed (position advanced to limit) and the returned buffer is rewound.
      Parameters:
      inBuffer - input data to compress (position to limit is compressed)
      rangeParams - encoding parameters controlling order, RLE, PACK, STRIPE, and other flags
      Returns:
      a rewound ByteBuffer containing the compressed data