public class BlockAllocationTableWriter extends Object implements BlockWritable, BATManaged
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.
Modifier and Type | Field and Description |
---|---|
private BATBlock[] |
_blocks |
private IntList |
_entries |
private int |
_start_block |
Constructor and Description |
---|
BlockAllocationTableWriter()
create a BlockAllocationTableWriter
|
Modifier and Type | Method and Description |
---|---|
int |
allocateSpace(int blockCount)
Allocate space for a block of indices
|
int |
countBlocks()
Return the number of BigBlock's this instance uses
|
int |
createBlocks(int size)
Create the BATBlocks we need
|
int |
getStartBlock()
get the starting block
|
void |
setStartBlock(int start_block)
Set the start block for this instance
|
(package private) void |
simpleCreateBlocks(int size)
create the BATBlocks
|
void |
writeBlocks(OutputStream stream)
Write the storage to an OutputStream
|
private IntList _entries
private BATBlock[] _blocks
private int _start_block
public BlockAllocationTableWriter()
public int createBlocks(int size)
public int allocateSpace(int blockCount)
blockCount
- the number of blocks to allocate space forpublic int getStartBlock()
void simpleCreateBlocks(int size)
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
streampublic int countBlocks()
countBlocks
in interface BATManaged
public void setStartBlock(int start_block)
setStartBlock
in interface BATManaged
start_block
- Copyright © 2016 Open Microscopy Environment