Package htsjdk.samtools.cram.encoding.reader

# Class CramRecordReader

java.lang.Object
htsjdk.samtools.cram.encoding.reader.CramRecordReader

public final class CramRecordReader extends Object
A reader used to consume and populate encoded `CRAMCompressionRecord`s from a set of streams representing data series/blocks in a Slice. This is essentially a bridge between the various data series streams associated in a `Slice` and the corresponding `CRAMCompressionRecord` fields.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final ValidationStringency`
`validationStringency`

## Constructor Summary

Constructors
Constructor
Description
`CramRecordReader(Slice slice, CompressorCache compressorCache, ValidationStringency validationStringency)`
Initialize a Cram Record Reader

## Method Summary

Modifier and Type
Method
Description
`CRAMCompressionRecord`
`readCRAMRecord(long sequentialIndex, int prevAlignmentStart)`
Read a CRAMCompressionRecord, using this reader's data series readers.

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

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

## Field Details

### validationStringency

protected final ValidationStringency validationStringency

## Constructor Details

### CramRecordReader

public CramRecordReader(Slice slice, CompressorCache compressorCache, ValidationStringency validationStringency)
Initialize a Cram Record Reader

Parameters:
  `slice` - the slice into which the records should be read
  `validationStringency` - how strict to be when reading this CRAM record

## Method Details

### readCRAMRecord

public CRAMCompressionRecord readCRAMRecord(long sequentialIndex, int prevAlignmentStart)
Read a CRAMCompressionRecord, using this reader's data series readers.

Parameters:
  `prevAlignmentStart` - the alignmentStart of the previous record, for position delta calculation
Returns:
  the newly-read CRAMCompressionRecord