Package htsjdk.samtools.cram.compression.nametokenisation

# 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 Summary

Constructors
Constructor
Description
`NameTokenisationEncode()`

## Method Summary

Modifier and Type
Method
Description
`ByteBuffer`
`compress(ByteBuffer inBuffer, boolean useArith, byte nameSeparator)`
Compress the input buffer of read names.

### Methods inherited from class java.lang.Object

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

## 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