| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | _has_free_sectors
Does this BATBlock have any free sectors in it? |
| private int[] | _values
For a regular fat block, these are 128 / 1024 next sector values. |
| private POIFSBigBlockSize | bigBlockSize
Either 512 bytes ( |
| private int | ourBlockIndex
Where in the file are we? |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static long | calculateMaximumSize(final POIFSBigBlockSize bigBlockSize, final int numBATs)
Calculates the maximum size of a file which is addressable given the number of FAT (BAT) sectors specified. |
| public static long | |
| public static BATBlock | createBATBlock(final POIFSBigBlockSize bigBlockSize, ByteBuffer data)
Create a single BATBlock from the byte buffer, which must hold at least one big block of data to be read. |
| public static BATBlock | createEmptyBATBlock(final POIFSBigBlockSize bigBlockSize, boolean isXBAT)
Creates a single BATBlock, with all the values set to empty. |
| public static BATBlock. | getBATBlockAndIndex(final int offset, final HeaderBlock header, final List<BATBlock> bats)
Returns the BATBlock that handles the specified offset, and the relative index within it. |
| public int | |
| public int | |
| public static BATBlock. | getSBATBlockAndIndex(final int offset, final HeaderBlock header, final List<BATBlock> sbats)
Returns the BATBlock that handles the specified offset, and the relative index within it, for the mini stream. |
| public int | |
| public int | |
| public boolean | |
| private void | |
| private byte[] | |
| public void | |
| public void | |
| public void | writeBlocks(final OutputStream
the OutputStream to which the stored data should
be written stream)Implements org. Write the block's data to an OutputStream |
| public void |
| _has_free_sectors | back to summary |
|---|---|
| private boolean _has_free_sectors Does this BATBlock have any free sectors in it? | |
| _values | back to summary |
|---|---|
| private int[] _values For a regular fat block, these are 128 / 1024 next sector values. For a XFat (DIFat) block, these are 127 / 1023 next sector values, then a chaining value. | |
| bigBlockSize | back to summary |
|---|---|
| private POIFSBigBlockSize bigBlockSize Either 512 bytes ( | |
| ourBlockIndex | back to summary |
|---|---|
| private int ourBlockIndex Where in the file are we? | |
| BATBlock | back to summary |
|---|---|
| private BATBlock(POIFSBigBlockSize bigBlockSize) Create a single instance initialized with default values | |
| calculateMaximumSize | back to summary |
|---|---|
| public static long calculateMaximumSize(final POIFSBigBlockSize bigBlockSize, final int numBATs) Calculates the maximum size of a file which is addressable given the number of FAT (BAT) sectors specified. (We don't care if those BAT blocks come from the 109 in the header, or from header + XBATS, it won't affect the calculation) The actual file size will be between [size of fatCount-1 blocks] and [size of fatCount blocks]. For 512 byte block sizes, this means we may over-estimate by up to 65kb. For 4096 byte block sizes, this means we may over-estimate by up to 4mb | |
| calculateMaximumSize | back to summary |
|---|---|
| public static long calculateMaximumSize(final HeaderBlock header) | |
| createBATBlock | back to summary |
|---|---|
| public static BATBlock createBATBlock(final POIFSBigBlockSize bigBlockSize, ByteBuffer data) Create a single BATBlock from the byte buffer, which must hold at least one big block of data to be read. | |
| createEmptyBATBlock | back to summary |
|---|---|
| public static BATBlock createEmptyBATBlock(final POIFSBigBlockSize bigBlockSize, boolean isXBAT) Creates a single BATBlock, with all the values set to empty. | |
| getBATBlockAndIndex | back to summary |
|---|---|
| public static BATBlock. Returns the BATBlock that handles the specified offset, and the relative index within it. The List of BATBlocks must be in sequential order | |
| getOccupiedSize | back to summary |
|---|---|
| public int getOccupiedSize() How much of this block is occupied?.
This counts the number of sectors up and including the last used sector.
Note that this is different from
| |
| getOurBlockIndex | back to summary |
|---|---|
| public int getOurBlockIndex() Retrieve where in the file we live | |
| getSBATBlockAndIndex | back to summary |
|---|---|
| public static BATBlock. Returns the BATBlock that handles the specified offset, and the relative index within it, for the mini stream. The List of BATBlocks must be in sequential order | |
| getUsedSectors | back to summary |
|---|---|
| public int getUsedSectors(boolean isAnXBAT) How many sectors in this block are taken?
Note that calling | |
| getValueAt | back to summary |
|---|---|
| public int getValueAt(int relativeOffset) | |
| hasFreeSectors | back to summary |
|---|---|
| public boolean hasFreeSectors() Does this BATBlock have any free sectors in it, or is it full? | |
| recomputeFree | back to summary |
|---|---|
| private void recomputeFree() | |
| serialize | back to summary |
|---|---|
| private byte[] serialize() | |
| setOurBlockIndex | back to summary |
|---|---|
| public void setOurBlockIndex(int index) Record where in the file we live | |
| setValueAt | back to summary |
|---|---|
| public void setValueAt(int relativeOffset, int value) | |
| writeBlocks | back to summary |
|---|---|
| public void writeBlocks(final OutputStream stream) throws IOException Implements org. Write the block's data to an OutputStream
| |
| writeData | back to summary |
|---|---|
| public void writeData(final ByteBuffer block) | |
| Modifier and Type | Field and Description |
|---|---|
| private final BATBlock | |
| private final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public BATBlock | |
| public int |
| block | back to summary |
|---|---|
| private final BATBlock block | |
| index | back to summary |
|---|---|
| private final int index | |
| BATBlockAndIndex | back to summary |
|---|---|
| private BATBlockAndIndex(int index, BATBlock block) | |
| getBlock | back to summary |
|---|---|
| public BATBlock getBlock() | |
| getIndex | back to summary |
|---|---|
| public int getIndex() | |