# Class FQZCompExternalCompressor

java.lang.Object
htsjdk.samtools.cram.compression.ExternalCompressor
htsjdk.samtools.cram.compression.fqzcomp.FQZCompExternalCompressor

public class FQZCompExternalCompressor extends ExternalCompressor
External compressor wrapper for the FQZComp quality score codec. Bridges the `ExternalCompressor` interface with the FQZComp encoder/decoder, extracting per-record metadata from the `CRAMCodecModelContext` that the encoder needs to determine record boundaries.

## Field Summary

### Fields inherited from class ExternalCompressor

`NO_COMPRESSION_ARG`

## Constructor Summary

Constructors
Constructor
Description
`FQZCompExternalCompressor(FQZCompEncode fqzCompEncoder, FQZCompDecode fqzCompDecoder)`

## Method Summary

Modifier and Type
Method
Description
`byte[]`
`compress(byte[] data, CRAMCodecModelContext contextModel)`
Compress quality score data using FQZComp.
`byte[]`
`uncompress(byte[] data)`
Decompress the data.

### Methods inherited from class ExternalCompressor

`equals, getCompressorForMethod, getMethod, hashCode, setMethod, toString`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### FQZCompExternalCompressor

public FQZCompExternalCompressor(FQZCompEncode fqzCompEncoder, FQZCompDecode fqzCompDecoder)

## Method Details

### compress

public byte[] compress(byte[] data, CRAMCodecModelContext contextModel)
Compress quality score data using FQZComp. Per-record quality score lengths are extracted from the context model; if unavailable or mismatched, the data is treated as a single record. Empty data is returned as-is.

Specified by:
  `compress` in class `ExternalCompressor`
Parameters:
  `data` - concatenated quality scores
  `contextModel` - context containing per-record lengths and flags, or null
Returns:
  compressed data

### uncompress

public byte[] uncompress(byte[] data)
Decompress the data.

Specified by:
  `uncompress` in class `ExternalCompressor`
Parameters:
  `data` - the compressed data
Returns:
  the decompressed data