Class NameTokenisationEncode

java.lang.Object
htsjdk.samtools.cram.compression.nametokenisation.NameTokenisationEncode

public class NameTokenisationEncode extends Object
A very naive implementation of a name tokenization encoder. It does not currently: - recognize and encode for duplicate streams (that is, it does not ever set the DUP_PREVIOUS_STREAM_FLAG_MASK flag) - detect and encode for streams that are all match, as mentioned in the spec ("if a byte stream of token types is entirely MATCH apart from the very first value it is discarded. It is possible to regenerate this during decode by observing the other byte streams.")
  • Constructor Details

    • NameTokenisationEncode

      public NameTokenisationEncode()
  • Method Details

    • compress

      public ByteBuffer compress(ByteBuffer inBuffer, boolean useArith, byte nameSeparator)
      Compress the input buffer of read names.
      Parameters:
      inBuffer - formatted as read names separated by the byte specified by the nameSeparator parameter (this generally happens as a result of using the ByteStopCodec to write the read names)
      useArith - true if the arithmetic coder should be used
      nameSeparator - name separator
      Returns:
      the compressed buffer