public class ContainerIO
extends java.lang.Object
| Constructor and Description |
|---|
ContainerIO() |
| Modifier and Type | Method and 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,
java.io.InputStream inputStream)
Reads a CRAM container from the input stream.
|
static Container |
readContainerHeader(int major,
java.io.InputStream inputStream)
Reads container header only from a
InputStream. |
static int |
writeContainer(Version version,
Container container,
java.io.OutputStream outputStream)
Writes a complete
Container with it's header to a OutputStream. |
static int |
writeContainerHeader(int major,
Container container,
java.io.OutputStream outputStream)
Writes a
Container header information to a OutputStream. |
public static Container readContainer(Version version, java.io.InputStream inputStream) throws java.io.IOException
version - CRAM version to expectinputStream - the stream to read fromjava.io.IOException - as per java IO contractpublic static Container readContainerHeader(int major, java.io.InputStream inputStream) throws java.io.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).java.io.IOException - as per java IO contractpublic static int writeContainerHeader(int major,
Container container,
java.io.OutputStream outputStream)
throws java.io.IOException
Container header information to a OutputStream.major - the CRAM version to assumecontainer - the container holding the header to writeoutputStream - the stream to write tojava.io.IOException - as per java IO contractpublic static int writeContainer(Version version, Container container, java.io.OutputStream outputStream) throws java.io.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 tojava.io.IOException - as per java IO contractpublic static long getByteSize(Version version, Container container)
version - the CRAM version to assumecontainer - the container to be weighted