Package htsjdk.beta.plugin

# Interface HtsEncoder<H extends HtsHeader,R extends HtsRecord>

Type Parameters:
  `H` - type param for the header for this encoder's format (i.e. SAMFileHeader)
  `R` - type param for the record for this encoder's format (i.e. SAMRecord)

All Superinterfaces:
  `AutoCloseable`, `Closeable`

All Known Subinterfaces:
  `HaploidReferenceEncoder`, `ReadsEncoder`, `VariantsEncoder`

All Known Implementing Classes:
  `BAMEncoder`, `BAMEncoderV1_0`, `CRAMEncoder`, `CRAMEncoderV2_1`, `CRAMEncoderV3_0`, `CRAMEncoderV3_1`, `SAMEncoder`, `SAMEncoderV1_0`, `VCFEncoder`, `VCFEncoderV3_2`, `VCFEncoderV3_3`, `VCFEncoderV4_0`, `VCFEncoderV4_1`, `VCFEncoderV4_2`

public interface HtsEncoder<H extends HtsHeader,R extends HtsRecord> extends Closeable
Base interface for encoders.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Close any resources associated with this decoder.
`String`
`getDisplayName()`
Get a user-friendly display name for this encoder.
`String`
`getFileFormat()`
Get the name of the file format supported by this encoder.
`HtsVersion`
`getVersion()`
Get the version of the file format supported by this encoder.
`void`
`setHeader(H header)`
Set the file format header for this decoder, of type `HtsEncoder`.
`void`
`write(R record)`
Write a single record to the underlying output.

## Method Details

### getFileFormat

String getFileFormat()
Get the name of the file format supported by this encoder. The format name defines the underlying format handled by this encoder, and also corresponds to the format of the primary bundle resource that is required when encoding (see `BundleResourceType` and `BundleResource.getFileFormat()`).

Returns:
  the name of the underlying file format handled by this encoder

### getVersion

HtsVersion getVersion()
Get the version of the file format supported by this encoder.

### getDisplayName

String getDisplayName()
Get a user-friendly display name for this encoder.

Returns:
  a user-friendly display name for this encoder for use in error and warning messages

### setHeader

void setHeader(H header)
Set the file format header for this decoder, of type `HtsEncoder`. `setHeader(HtsHeader)` must be called before `write(HtsRecord)` can be called.

Parameters:
  `header` - to use

### write

void write(R record)
Write a single record to the underlying output. `write(HtsRecord)` may only called after `setHeader(HtsHeader)` has been called.

Parameters:
  `record` - record to write

### close

void close()
Close any resources associated with this decoder.

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`