public class SliceBlocks
extends java.lang.Object
Slice, not including the Slice header block,
which is managed by Slice.
Prevents duplicate blocks (blocks with non-unique content ID) or illogical blocks (i.e., setting
a core block that is not of type core block, or an external block that is not an external block) from
being added.| Constructor and Description |
|---|
SliceBlocks(Block coreBlock,
java.util.List<Block> externalBlocks)
Create a new SliceBlocks object from a core block and one or more external blocks.
|
SliceBlocks(CRAMVersion cramVersion,
int numberOfBlocks,
java.io.InputStream inputStream)
Read the set of blocks that make up a slice from a CRAM stream.
|
| Modifier and Type | Method and Description |
|---|---|
Block |
getCoreBlock()
Return the core block for this Slice.
|
Block |
getExternalBlock(java.lang.Integer contentID)
Get the external block corresponding to a contentID.
|
java.util.List<java.lang.Integer> |
getExternalContentIDs()
Return a list of external content IDs.
|
int |
getNumberOfExternalBlocks()
Number of external locks present in this SliceBlocks object (does not include the core block).
|
void |
writeBlocks(CRAMVersion cramVersion,
java.io.OutputStream outputStream)
Write the coreBlock and each external block out to a CRAM stream.
|
public SliceBlocks(Block coreBlock, java.util.List<Block> externalBlocks)
coreBlock - the core block for the Slice, may not be nullexternalBlocks - the external blocks for this Slice, may not be null and must contain a least one blockpublic SliceBlocks(CRAMVersion cramVersion, int numberOfBlocks, java.io.InputStream inputStream)
cramVersion - CRAM version being readnumberOfBlocks - number of blocks to consume from the streaminputStream - stream to consumepublic Block getCoreBlock()
public Block getExternalBlock(java.lang.Integer contentID)
contentID - contentID identifying the external blockpublic java.util.List<java.lang.Integer> getExternalContentIDs()
getExternalBlock(java.lang.Integer).public int getNumberOfExternalBlocks()
public void writeBlocks(CRAMVersion cramVersion, java.io.OutputStream outputStream)
cramVersion - CRAM major version being writtenoutputStream - stream to write blocks to