public class Block
extends java.lang.Object
Constructor and Description |
---|
Block() |
Modifier and Type | Method and Description |
---|---|
static Block |
buildNewCore(byte[] rawContent)
Create a new core block with the given uncompressed content.
|
static Block |
buildNewFileHeaderBlock(byte[] rawContent)
Create a new core block with the given uncompressed content.
|
static Block |
buildNewSliceHeaderBlock(byte[] rawContent)
Create a new slice header block with the given uncompressed content.
|
int |
getCompressedContentSize() |
int |
getContentId() |
BlockContentType |
getContentType() |
byte[] |
getRawContent() |
int |
getRawContentSize() |
static Block |
readFromInputStream(int major,
java.io.InputStream inputStream)
Deserialize the block from the
InputStream . |
void |
setContent(byte[] raw,
byte[] compressed) |
void |
setContentId(int contentId) |
void |
setContentType(BlockContentType contentType) |
void |
setMethod(BlockCompressionMethod method) |
void |
setRawContent(byte[] raw) |
java.lang.String |
toString() |
void |
write(int major,
java.io.OutputStream outputStream)
Write the block out to the the specified
OutputStream . |
public static Block readFromInputStream(int major, java.io.InputStream inputStream) throws java.io.IOException
InputStream
. The reading is parametrized by the major CRAM version number.major
- CRAM version major numberinputStream
- input stream to read the block fromBlock
object with fields and content from the input streamjava.io.IOException
- as per java IO contractpublic static Block buildNewSliceHeaderBlock(byte[] rawContent)
rawContent
- the content of the blockBlock
objectpublic static Block buildNewCore(byte[] rawContent)
rawContent
- the content of the blockBlock
objectpublic static Block buildNewFileHeaderBlock(byte[] rawContent)
rawContent
- the content of the blockBlock
objectpublic java.lang.String toString()
toString
in class java.lang.Object
public void setRawContent(byte[] raw)
public byte[] getRawContent()
public int getRawContentSize()
public void setContent(byte[] raw, byte[] compressed)
public void write(int major, java.io.OutputStream outputStream) throws java.io.IOException
OutputStream
. The method is parametrized with CRAM major version number.major
- CRAM version major numberoutputStream
- output stream to write tojava.io.IOException
- as per java IO contractpublic void setMethod(BlockCompressionMethod method)
public BlockContentType getContentType()
public void setContentType(BlockContentType contentType)
public int getContentId()
public void setContentId(int contentId)
public int getCompressedContentSize()