prepareForRecords
public OutputStream prepareForRecords(OutputStream out,
SAMFormat format,
htsjdk.samtools.SAMFileHeader header)
throws IOException
Prepares the given output stream for writing of SAMRecords in the given
format. This includes writing the given SAM header and, in the case of
BAM or CRAM, writing some further metadata as well as compressing everything
written. Returns a new stream to replace the original: it will do the
appropriate compression for BAM/CRAM files.
- Throws:
IOException