Package htsjdk.samtools.cram.encoding.writer

# Class CramRecordWriter

java.lang.Object
htsjdk.samtools.cram.encoding.writer.CramRecordWriter

public class CramRecordWriter extends Object
A writer that emits CRAMCompressionRecord into the various streams that represent a Slice's data series blocks. This essentially acts as a bridge between CRAMCompressionRecord fields and the various data series streams associated with a Slice. It is the inverse of CramRecordReader.

## Constructor Summary

Constructors
Constructor
Description
`CramRecordWriter(Slice slice)`
Initializes a Cram Record Writer

## Method Summary

Modifier and Type
Method
Description
`SliceBlocks`
`writeToSliceBlocks(CRAMCodecModelContext contextModel, List<CRAMCompressionRecord> records, int initialAlignmentStart)`
Writes a series of Cram Compression Records to the underlying `SliceBlocks`, using this class's Encodings

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

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

## Constructor Details

### CramRecordWriter

public CramRecordWriter(Slice slice)
Initializes a Cram Record Writer

Parameters:
  `slice` - the target slice to which the records will be written

## Method Details

### writeToSliceBlocks

public SliceBlocks writeToSliceBlocks(CRAMCodecModelContext contextModel, List<CRAMCompressionRecord> records, int initialAlignmentStart)
Writes a series of Cram Compression Records to the underlying `SliceBlocks`, using this class's Encodings

Parameters:
  `records` - the Cram Compression Records to write
  `initialAlignmentStart` - the alignmentStart of the enclosing `Slice`, for delta calculation
Returns:
  a `SliceBlocks` object