public final class CramIO
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CRAM_FILE_EXTENSION
Deprecated.
since June 2019 Use
FileExtensions.CRAM instead. |
static int |
EOF_ALIGNMENT_SPAN |
static int |
EOF_ALIGNMENT_START |
static int |
EOF_BLOCK_SIZE_V2 |
static int |
EOF_BLOCK_SIZE_V3 |
static byte[] |
ZERO_B_EOF_MARKER
The 'zero-B' EOF marker as per CRAM specs v2.1.
|
static byte[] |
ZERO_F_EOF_MARKER
The zero-F EOF marker as per CRAM specs v3.0.
|
Constructor and Description |
---|
CramIO() |
Modifier and Type | Method and Description |
---|---|
static CramHeader |
readCramHeader(java.io.InputStream inputStream)
Read CRAM header from the given
InputStream . |
static byte[] |
samHeaderToByteArray(SAMFileHeader samFileHeader) |
static long |
writeCramEOF(CRAMVersion cramVersion,
java.io.OutputStream outputStream)
Write an end-of-file marker to the
OutputStream . |
static long |
writeCramHeader(CramHeader cramHeader,
java.io.OutputStream outputStream)
Writes CRAM header into the specified
OutputStream . |
@Deprecated public static final java.lang.String CRAM_FILE_EXTENSION
FileExtensions.CRAM
instead.public static final byte[] ZERO_B_EOF_MARKER
public static final byte[] ZERO_F_EOF_MARKER
public static final int EOF_ALIGNMENT_START
public static final int EOF_BLOCK_SIZE_V3
public static final int EOF_BLOCK_SIZE_V2
public static final int EOF_ALIGNMENT_SPAN
public static long writeCramEOF(CRAMVersion cramVersion, java.io.OutputStream outputStream)
OutputStream
. The specific EOF marker is chosen based on
the CRAM version. On read, this is interpreted as a special container sentinel indicating no more containers.
The treatment of these EOF markers is asymmetric in that on read, the EOF marker is read in as a special
container with sentinel values indicating it is an EOF container (as defined by the spec).cramVersion
- the CRAM version to assumeoutputStream
- the stream to write topublic static long writeCramHeader(CramHeader cramHeader, java.io.OutputStream outputStream)
OutputStream
.cramHeader
- the CramHeader
object to writeoutputStream
- the output stream to write topublic static CramHeader readCramHeader(java.io.InputStream inputStream)
InputStream
.inputStream
- input stream to read fromCramHeader
objectpublic static byte[] samHeaderToByteArray(SAMFileHeader samFileHeader)