public final class CompressionHeaderFactory
extends java.lang.Object
CRAMEncodingStrategy object to determine which encodings
to use for the fixed CRAM data series, and dynamically chooses the best encoding for tag data series.| Modifier and Type | Field and Description |
|---|---|
static int |
ALL_BYTES_USED |
static int |
BYTE_SPACE_SIZE |
| Constructor and Description |
|---|
CompressionHeaderFactory(CRAMEncodingStrategy encodingStrategy)
Create a CompressionHeaderFactory using the provided CRAMEncodingStrategy.
|
| Modifier and Type | Method and Description |
|---|---|
CompressionHeader |
createCompressionHeader(java.util.List<CRAMCompressionRecord> containerCRAMCompressionRecords,
boolean coordinateSorted)
Creates a compression header for the provided list of
CRAMCompressionRecord objects. |
ExternalCompressor |
getBestExternalCompressor(byte[] data)
Get the best external compressor to use for the given byte array.
|
static htsjdk.samtools.cram.build.CompressionHeaderFactory.ByteSizeRange |
getByteSizeRangeOfTagValues(java.util.List<CRAMCompressionRecord> records,
int tagID) |
CRAMEncodingStrategy |
getEncodingStrategy() |
public static final int BYTE_SPACE_SIZE
public static final int ALL_BYTES_USED
public CompressionHeaderFactory(CRAMEncodingStrategy encodingStrategy)
encodingStrategy - CRAMEncodingStrategy to use, may not be nullpublic CompressionHeader createCompressionHeader(java.util.List<CRAMCompressionRecord> containerCRAMCompressionRecords, boolean coordinateSorted)
CRAMCompressionRecord objects. Resets any internal
state (i.e. the tag encoding map state) as preparation for starting the next compression header.containerCRAMCompressionRecords - all CRAMRecords that will be stored in the containercoordinateSorted - if true the records are assumed to be sorted by alignment
positionCompressionHeader for the container for containerCRAMRecordspublic CRAMEncodingStrategy getEncodingStrategy()
public ExternalCompressor getBestExternalCompressor(byte[] data)
data - byte array to compresspublic static htsjdk.samtools.cram.build.CompressionHeaderFactory.ByteSizeRange getByteSizeRangeOfTagValues(java.util.List<CRAMCompressionRecord> records, int tagID)