public class BATBlock extends Object
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
|
protected void |
doWriteData(OutputStream stream,
byte[] data)
Default implementation of write for extending classes that
contain their data in a simple array of bytes.
|
static int |
entriesPerBlock(int size) |
static int |
entriesPerXBATBlock(int size) |
int |
getBigBlockSize() |
static int |
getXBATChainOffset(int size) |
void |
writeBlocks(OutputStream stream)
Write the storage to an OutputStream
|
public int getBigBlockSize()
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)
protected void doWriteData(OutputStream stream, byte[] data) throws IOException
stream
- the OutputStream to which the data should be
written.data
- the byte array of to be written.IOException
- on problems writing to the specified
stream.public void writeBlocks(OutputStream stream) throws IOException
writeBlocks
in interface BlockWritable
stream
- the OutputStream to which the stored data should
be writtenIOException
- on problems writing to the specified
streamCopyright © 2014 Open Microscopy Environment