# Class BinaryFeatureCodec<T extends Feature>

java.lang.Object
htsjdk.tribble.BinaryFeatureCodec<T>

All Implemented Interfaces:
  `FeatureCodec<T, PositionalBufferedStream>`

Direct Known Subclasses:
  `BCF2Codec, ExampleBinaryCodec`

public abstract class BinaryFeatureCodec<T extends Feature> extends Object implements FeatureCodec<T, PositionalBufferedStream>
Implements common methods of `FeatureCodec`s that read from `PositionalBufferedStream`s.

## Constructor Summary

Constructors
Constructor
Description
`BinaryFeatureCodec()`

## Method Summary

Modifier and Type
Method
Description
`void`
`close(PositionalBufferedStream source)`
Adapter method that closes the provided `SOURCE`.
`final TabixFormat`
`getTabixFormat()`
Marked as final because binary features could not be tabix indexed
`boolean`
`isDone(PositionalBufferedStream source)`
Adapter method that assesses whether the provided `SOURCE` has more data.
`LocationAware`
`makeIndexableSourceFromStream(InputStream bufferedInputStream)`
`PositionalBufferedStream` is already `LocationAware`.
`PositionalBufferedStream`
`makeSourceFromStream(InputStream bufferedInputStream)`
Generates a reader of type `SOURCE` appropriate for use by this codec from the generic input stream.

### Methods inherited from class Object

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

### Methods inherited from interface FeatureCodec

`canDecode, decode, decodeLoc, getFeatureType, getPathToDataFile, readHeader`

## Constructor Details

### BinaryFeatureCodec

public BinaryFeatureCodec()

## Method Details

### makeSourceFromStream

public PositionalBufferedStream makeSourceFromStream(InputStream bufferedInputStream)
Description copied from interface: `FeatureCodec`
Generates a reader of type `SOURCE` appropriate for use by this codec from the generic input stream. Implementers should assume the stream is buffered.

Specified by:
  `makeSourceFromStream` in interface `FeatureCodec<T extends Feature, PositionalBufferedStream>`

### makeIndexableSourceFromStream

public LocationAware makeIndexableSourceFromStream(InputStream bufferedInputStream)
`PositionalBufferedStream` is already `LocationAware`.

Specified by:
  `makeIndexableSourceFromStream` in interface `FeatureCodec<T extends Feature, PositionalBufferedStream>`

### close

public void close(PositionalBufferedStream source)
Description copied from interface: `FeatureCodec`
Adapter method that closes the provided `SOURCE`.

Specified by:
  `close` in interface `FeatureCodec<T extends Feature, PositionalBufferedStream>`

### isDone

public boolean isDone(PositionalBufferedStream source)
Description copied from interface: `FeatureCodec`
Adapter method that assesses whether the provided `SOURCE` has more data. True if it does, false otherwise.

Specified by:
  `isDone` in interface `FeatureCodec<T extends Feature, PositionalBufferedStream>`

### getTabixFormat

public final TabixFormat getTabixFormat()
Marked as final because binary features could not be tabix indexed

Specified by:
  `getTabixFormat` in interface `FeatureCodec<T extends Feature, PositionalBufferedStream>`
Returns:
  the format to use with tabix