public class ContainerIO extends Object
Constructor | Description |
---|---|
ContainerIO() |
Modifier and Type | Method | Description |
---|---|---|
static long |
getByteSize(Version version,
Container container) |
Calculates the byte size of a container based on the CRAM version.
|
static Container |
readContainer(Version version,
InputStream inputStream) |
Reads a CRAM container from the input stream.
|
static Container |
readContainerHeader(int major,
InputStream inputStream) |
Reads container header only from a
InputStream . |
static int |
writeContainer(Version version,
Container container,
OutputStream outputStream) |
Writes a complete
Container with it's header to a OutputStream . |
static int |
writeContainerHeader(int major,
Container container,
OutputStream outputStream) |
Writes a
Container header information to a OutputStream . |
public static Container readContainer(Version version, InputStream inputStream) throws IOException
version
- CRAM version to expectinputStream
- the stream to read fromIOException
- as per java IO contractpublic static Container readContainerHeader(int major, InputStream inputStream) throws IOException
InputStream
.major
- the CRAM version to assumeinputStream
- the input stream to read fromContainer
object with container header values filled out but empty body (no slices and blocks).IOException
- as per java IO contractpublic static int writeContainerHeader(int major, Container container, OutputStream outputStream) throws IOException
Container
header information to a OutputStream
.major
- the CRAM version to assumecontainer
- the container holding the header to writeoutputStream
- the stream to write toIOException
- as per java IO contractpublic static int writeContainer(Version version, Container container, OutputStream outputStream) throws IOException
Container
with it's header to a OutputStream
. The method is aware of file header containers and is
suitable for general purpose use: basically any container is allowed.version
- the CRAM version to assumecontainer
- the container to writeoutputStream
- the stream to write toIOException
- as per java IO contractpublic static long getByteSize(Version version, Container container)
version
- the CRAM version to assumecontainer
- the container to be weighted