# Class BAMDecoder

java.lang.Object
htsjdk.beta.codecs.reads.bam.BAMDecoder

All Implemented Interfaces:
  `HtsDecoder<SAMFileHeader, SAMRecord>, HtsQuery<SAMRecord>, ReadsDecoder, ReadsQuery<SAMRecord>, Closeable, AutoCloseable, Iterable<SAMRecord>`

Direct Known Subclasses:
  `BAMDecoderV1_0`

@InternalAPI public abstract class BAMDecoder extends Object implements ReadsDecoder
InternalAPI Base class for `BundleResourceType.FMT_READS_BAM` decoders.

## Constructor Summary

Constructors
Constructor
Description
`BAMDecoder(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions)`
Create a BAM decoder for the given input bundle.

## Method Summary

Modifier and Type
Method
Description
`final String`
`getDisplayName()`
Get a user-friendly display name for this decoder.
`final String`
`getFileFormat()`
Get the name of the file format supported by this decoder.The format name defines the underlying format handled by this decoder, and also corresponds to the format of the primary bundle resource that is required when decoding (see `BundleResourceType` and `BundleResource.getFileFormat()`).
`Bundle`
`getInputBundle()`
Get the input `Bundle` for this decoder.
`ReadsDecoderOptions`
`getReadsDecoderOptions()`
Get the `ReadsDecoderOptions` for this decoder.

### Methods inherited from class Object

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

### Methods inherited from interface HtsDecoder

`close, getHeader, getVersion`

### Methods inherited from interface HtsQuery

`hasIndex, isQueryable, iterator, query, query, query, query, queryContained, queryContained, queryContained, queryOverlapping, queryOverlapping, queryOverlapping, queryStart`

### Methods inherited from interface Iterable

`forEach, spliterator`

### Methods inherited from interface ReadsDecoder

`queryMate, queryUnmapped`

## Constructor Details

### BAMDecoder

@InternalAPI public BAMDecoder(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions)
Create a BAM decoder for the given input bundle. The primary resource in the bundle must have content type `BundleResourceType.CT_ALIGNED_READS`, and the resource must be an appropriate format and version for this encoder (to find an encoder for a bundle, see `ReadsResolver`.

Parameters:
  `inputBundle` - input `Bundle` to decode
  `readsDecoderOptions` - `ReadsDecoderOptions` to use

## Method Details

### getFileFormat

public final String getFileFormat()
Description copied from interface: `HtsDecoder`
Get the name of the file format supported by this decoder.The format name defines the underlying format handled by this decoder, and also corresponds to the format of the primary bundle resource that is required when decoding (see `BundleResourceType` and `BundleResource.getFileFormat()`).

Specified by:
  `getFileFormat` in interface `HtsDecoder<SAMFileHeader, SAMRecord>`
Returns:
  the name of the underlying file format handled by this decoder

### getDisplayName

public final String getDisplayName()
Description copied from interface: `HtsDecoder`
Get a user-friendly display name for this decoder.

Specified by:
  `getDisplayName` in interface `HtsDecoder<SAMFileHeader, SAMRecord>`
Returns:
  a user-friendly display name for this decoder for use in error and warning messages

### getInputBundle

public Bundle getInputBundle()
Get the input `Bundle` for this decoder.

Returns:
  the input `Bundle` for this decoder

### getReadsDecoderOptions

public ReadsDecoderOptions getReadsDecoderOptions()
Get the `ReadsDecoderOptions` for this decoder.

Returns:
  the `ReadsDecoderOptions` for this decoder.