public class BATBlock extends BigBlock
Modifier and Type | Field and Description |
---|---|
private byte[] |
_data |
private static byte |
_default_value |
private int |
_entries_per_block |
private IntegerField[] |
_fields |
private int |
_xbat_chain_offset |
private int |
blockSize |
Modifier | Constructor and Description |
---|---|
private |
BATBlock(int blockSize)
Create a single instance initialized with default values
|
private |
BATBlock(int[] entries,
int start_index,
int end_index,
int size)
Create a single instance initialized (perhaps partially) with entries
|
Modifier and Type | Method and Description |
---|---|
static int |
calculateStorageRequirements(int entryCount,
int size)
Calculate how many BATBlocks are needed to hold a specified
number of BAT entries.
|
static int |
calculateXBATStorageRequirements(int entryCount,
int size)
Calculate how many XBATBlocks are needed to hold a specified
number of BAT entries.
|
static BATBlock[] |
createBATBlocks(int[] entries,
int size)
Create an array of BATBlocks from an array of int block
allocation table entries
|
static BATBlock[] |
createXBATBlocks(int[] entries,
int startBlock,
int size)
Create an array of XBATBlocks from an array of int block
allocation table entries
|
static int |
entriesPerBlock(int size) |
static int |
entriesPerXBATBlock(int size) |
int |
getBigBlockSize() |
static int |
getXBATChainOffset(int size) |
private void |
setXBATChain(int chainIndex) |
(package private) void |
writeData(OutputStream stream)
Write the block's data to an OutputStream
|
doWriteData, writeBlocks
private static final byte _default_value
private IntegerField[] _fields
private byte[] _data
private int _entries_per_block
private int _xbat_chain_offset
private int blockSize
private BATBlock(int blockSize)
private BATBlock(int[] entries, int start_index, int end_index, int size)
entries
- the array of block allocation table entriesstart_index
- the index of the first entry to be written
to the blockend_index
- the index, plus one, of the last entry to be
written to the block (writing is for all index
k, start_index <= k < end_index)public int getBigBlockSize()
getBigBlockSize
in class BigBlock
public static BATBlock[] createBATBlocks(int[] entries, int size)
entries
- the array of int entriespublic static BATBlock[] createXBATBlocks(int[] entries, int startBlock, int size)
entries
- the array of int entriesstartBlock
- the start block of the array of XBAT blockspublic static int calculateStorageRequirements(int entryCount, int size)
entryCount
- the number of entriespublic static int calculateXBATStorageRequirements(int entryCount, int size)
entryCount
- the number of entriespublic static final int entriesPerBlock(int size)
public static final int entriesPerXBATBlock(int size)
public static final int getXBATChainOffset(int size)
private void setXBATChain(int chainIndex)
void writeData(OutputStream stream) throws IOException
writeData
in class BigBlock
stream
- the OutputStream to which the stored data should
be writtenIOException
- on problems writing to the specified
streamCopyright © 2015 Open Microscopy Environment