public class BlockAllocationTableReader extends Object
Each block of the filesystem has an index. The first block, the header, is skipped; the first block after the header is index 0, the next is index 1, and so on.
A block's index is also its index into the Block Allocation Table. The entry that it finds in the Block Allocation Table is the index of the next block in the linked list of blocks making up a file, or it is set to -2: end of list.
Constructor and Description |
---|
BlockAllocationTableReader()
Constructor BlockAllocationTableReader
|
BlockAllocationTableReader(int block_count,
int[] block_array,
int xbat_count,
int xbat_index,
BlockList raw_block_list,
int size)
create a BlockAllocationTableReader for an existing filesystem.
|
BlockAllocationTableReader(ListManagedBlock[] blocks,
BlockList raw_block_list,
int size)
create a BlockAllocationTableReader from an array of raw data blocks
|
Modifier and Type | Method and Description |
---|---|
(package private) ListManagedBlock[] |
fetchBlocks(int startBlock,
BlockList blockList)
walk the entries from a specified point and return the
associated blocks.
|
(package private) int |
getNextBlockIndex(int index)
return the next block index
|
(package private) boolean |
isUsed(int index)
determine whether the block specified by index is used or not
|
private void |
setEntries(ListManagedBlock[] blocks,
BlockList raw_blocks,
int size)
Convert an array of blocks into a set of integer indices
|
private IntList _entries
public BlockAllocationTableReader(int block_count, int[] block_array, int xbat_count, int xbat_index, BlockList raw_block_list, int size) throws IOException
block_count
- the number of BAT blocks making up the block
allocation tableblock_array
- the array of BAT block indices from the
filesystem's headerxbat_count
- the number of XBAT blocksxbat_index
- the index of the first XBAT blockraw_block_list
- the list of RawDataBlocksIOException
- if, in trying to create the table, we
encounter logic errorsBlockAllocationTableReader(ListManagedBlock[] blocks, BlockList raw_block_list, int size) throws IOException
blocks
- the raw dataraw_block_list
- the list holding the managed blocksIOException
BlockAllocationTableReader()
ListManagedBlock[] fetchBlocks(int startBlock, BlockList blockList) throws IOException
startBlock
- the first block in the chainblockList
- the raw data block listIOException
- if there is a problem acquiring the blocksboolean isUsed(int index)
index
- index of block in questionint getNextBlockIndex(int index) throws IOException
index
- of the current blockIOException
- if the current block is unusedprivate void setEntries(ListManagedBlock[] blocks, BlockList raw_blocks, int size) throws IOException
blocks
- the array of blocks containing the indicesraw_blocks
- the list of blocks being managed. Unused
blocks will be eliminated from the listIOException
Copyright © 2016 Open Microscopy Environment