# Class EncodingFactory

java.lang.Object
htsjdk.samtools.cram.encoding.EncodingFactory

public class EncodingFactory extends Object
A helper class to choose and instantiate an appropriate `CRAMEncoding` given a `DataSeriesType` and an `EncodingDescriptor`.

## Constructor Summary

Constructors
Constructor
Description
`EncodingFactory()`

## Method Summary

Modifier and Type
Method
Description
`static <T> CRAMEncoding<T>`
`createCRAMEncoding(DataSeriesType valueType, EncodingDescriptor encodingDescriptor)`
Use the data series value type and EncodingDescriptor to instantiate a corresponding CRAMEncoding of the correct (generic) type.
`static <T> CRAMEncoding<T>`
`createCRAMEncoding(DataSeriesType valueType, EncodingID encodingID, byte[] params)`
Create an encoding of the correct type for the data series type and encoding id and params.

### Methods inherited from class Object

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

## Constructor Details

### EncodingFactory

public EncodingFactory()

## Method Details

### createCRAMEncoding

public static <T> CRAMEncoding<T> createCRAMEncoding(DataSeriesType valueType, EncodingDescriptor encodingDescriptor)
Use the data series value type and EncodingDescriptor to instantiate a corresponding CRAMEncoding of the correct (generic) type.

Type Parameters:
  `T` -
Parameters:
  `valueType` -
  `encodingDescriptor` -
Returns:

### createCRAMEncoding

public static <T> CRAMEncoding<T> createCRAMEncoding(DataSeriesType valueType, EncodingID encodingID, byte[] params)
Create an encoding of the correct type for the data series type and encoding id and params.

Type Parameters:
  `T` - encoding object type, like Integer or String.
Parameters:
  `valueType` - data type of the values to be produced/consumed by the encoding
  `encodingID` - encoding id used for data serialization
  `params` - encoding initialization values
Returns:
  a new encoding with the requested parameters