Package htsjdk.beta.codecs.reads.bam.bamV1_0

# Class BAMEncoderV1_0

java.lang.Object
htsjdk.beta.codecs.reads.bam.BAMEncoder
htsjdk.beta.codecs.reads.bam.bamV1_0.BAMEncoderV1_0

All Implemented Interfaces:
  `HtsEncoder<SAMFileHeader,SAMRecord>`, `ReadsEncoder`, `Closeable`, `AutoCloseable`

public class BAMEncoderV1_0 extends BAMEncoder
BAM v1.0 encoder.

## Constructor Summary

Constructors
Constructor
Description
`BAMEncoderV1_0(Bundle outputBundle, ReadsEncoderOptions readsEncoderOptions)`
Create a V1.0 BAM encoder for the given output bundle.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Close any resources associated with this decoder.
`HtsVersion`
`getVersion()`
Get the version of the file format supported by this encoder.
`void`
`setHeader(SAMFileHeader samFileHeader)`
Set the file format header for this decoder, of type `HtsEncoder`.
`void`
`write(SAMRecord record)`
Write a single record to the underlying output.

### Methods inherited from class htsjdk.beta.codecs.reads.bam.BAMEncoder

`getDisplayName, getFileFormat, getOutputBundle, getReadsEncoderOptions`

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

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

## Constructor Details

### BAMEncoderV1_0

public BAMEncoderV1_0(Bundle outputBundle, ReadsEncoderOptions readsEncoderOptions)
Create a V1.0 BAM encoder for the given output bundle. The primary resource in the bundle must have content type `BundleResourceType.CT_ALIGNED_READS` (to find a decoder for a bundle, see `ReadsResolver`).

Parameters:
  `outputBundle` - bundle to encode
  `readsEncoderOptions` - options to use

## Method Details

### getVersion

public HtsVersion getVersion()
Description copied from interface: `HtsEncoder`
Get the version of the file format supported by this encoder.

### setHeader

public void setHeader(SAMFileHeader samFileHeader)
Description copied from interface: `HtsEncoder`
Set the file format header for this decoder, of type `HtsEncoder`. `HtsEncoder.setHeader(HtsHeader)` must be called before `HtsEncoder.write(HtsRecord)` can be called.

Parameters:
  `samFileHeader` - to use

### write

public void write(SAMRecord record)
Description copied from interface: `HtsEncoder`
Write a single record to the underlying output. `HtsEncoder.write(HtsRecord)` may only called after `HtsEncoder.setHeader(HtsHeader)` has been called.

Parameters:
  `record` - record to write

### close

public void close()
Description copied from interface: `HtsEncoder`
Close any resources associated with this decoder.