Package org.apache.poi.poifs.filesystem
Class POIFSMiniStore
java.lang.Object
org.apache.poi.poifs.filesystem.BlockStore
org.apache.poi.poifs.filesystem.POIFSMiniStore
This class handles the MiniStream (small block store)
in the NIO case for
POIFSFileSystem
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.poifs.filesystem.BlockStore
BlockStore.ChainLoopDetector
-
Method Summary
Modifier and TypeMethodDescriptionprotected ByteBuffer
createBlockIfNeeded
(int offset) Load the block, extending the underlying stream if neededprotected BATBlock.BATBlockAndIndex
getBATBlockAndIndex
(int offset) Returns the BATBlock that handles the specified offset, and the relative index within itprotected ByteBuffer
getBlockAt
(int offset) Load the block at the given offset.protected int
Returns the size of the blocks managed through the block store.protected BlockStore.ChainLoopDetector
Creates a Detector for loops in the chainprotected int
Finds a free block, and returns its offset.protected int
getNextBlock
(int offset) Works out what block follows the specified one.protected void
setNextBlock
(int offset, int nextBlock) Changes the record of what block follows the specified one.
-
Method Details
-
getBlockAt
Load the block at the given offset.- Specified by:
getBlockAt
in classBlockStore
-
createBlockIfNeeded
Load the block, extending the underlying stream if needed- Specified by:
createBlockIfNeeded
in classBlockStore
- Throws:
IOException
-
getBATBlockAndIndex
Returns the BATBlock that handles the specified offset, and the relative index within it- Specified by:
getBATBlockAndIndex
in classBlockStore
-
getNextBlock
protected int getNextBlock(int offset) Works out what block follows the specified one.- Specified by:
getNextBlock
in classBlockStore
-
setNextBlock
protected void setNextBlock(int offset, int nextBlock) Changes the record of what block follows the specified one.- Specified by:
setNextBlock
in classBlockStore
-
getFreeBlock
Finds a free block, and returns its offset. This method will extend the file if needed, and if doing so, allocate new FAT blocks to address the extra space.- Specified by:
getFreeBlock
in classBlockStore
- Throws:
IOException
-
getChainLoopDetector
Description copied from class:BlockStore
Creates a Detector for loops in the chain- Specified by:
getChainLoopDetector
in classBlockStore
-
getBlockStoreBlockSize
protected int getBlockStoreBlockSize()Description copied from class:BlockStore
Returns the size of the blocks managed through the block store.- Specified by:
getBlockStoreBlockSize
in classBlockStore
-