Package org.apache.poi.poifs.filesystem
Class POIFSMiniStore
- java.lang.Object
-
- org.apache.poi.poifs.filesystem.BlockStore
-
- org.apache.poi.poifs.filesystem.POIFSMiniStore
-
public class POIFSMiniStore extends BlockStore
This class handles the MiniStream (small block store) in the NIO case forPOIFSFileSystem
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.poifs.filesystem.BlockStore
BlockStore.ChainLoopDetector
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ByteBuffercreateBlockIfNeeded(int offset)Load the block, extending the underlying stream if neededprotected BATBlock.BATBlockAndIndexgetBATBlockAndIndex(int offset)Returns the BATBlock that handles the specified offset, and the relative index within itprotected ByteBuffergetBlockAt(int offset)Load the block at the given offset.protected intgetBlockStoreBlockSize()Returns the size of the blocks managed through the block store.protected BlockStore.ChainLoopDetectorgetChainLoopDetector()Creates a Detector for loops in the chainprotected intgetFreeBlock()Finds a free block, and returns its offset.protected intgetNextBlock(int offset)Works out what block follows the specified one.protected voidreleaseBuffer(ByteBuffer buffer)Releases a mmap-ed buffer, which you are sure won't be used againprotected voidsetNextBlock(int offset, int nextBlock)Changes the record of what block follows the specified one.
-
-
-
Method Detail
-
getBlockAt
protected ByteBuffer getBlockAt(int offset) throws IOException
Load the block at the given offset.- Specified by:
getBlockAtin classBlockStore- Throws:
IOException
-
createBlockIfNeeded
protected ByteBuffer createBlockIfNeeded(int offset) throws IOException
Load the block, extending the underlying stream if needed- Specified by:
createBlockIfNeededin classBlockStore- Throws:
IOException
-
getBATBlockAndIndex
protected BATBlock.BATBlockAndIndex getBATBlockAndIndex(int offset)
Returns the BATBlock that handles the specified offset, and the relative index within it- Specified by:
getBATBlockAndIndexin classBlockStore
-
getNextBlock
protected int getNextBlock(int offset)
Works out what block follows the specified one.- Specified by:
getNextBlockin classBlockStore
-
setNextBlock
protected void setNextBlock(int offset, int nextBlock)Changes the record of what block follows the specified one.- Specified by:
setNextBlockin classBlockStore
-
getFreeBlock
protected int getFreeBlock() throws IOExceptionFinds 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:
getFreeBlockin classBlockStore- Throws:
IOException
-
getChainLoopDetector
protected BlockStore.ChainLoopDetector getChainLoopDetector()
Description copied from class:BlockStoreCreates a Detector for loops in the chain- Specified by:
getChainLoopDetectorin classBlockStore
-
getBlockStoreBlockSize
protected int getBlockStoreBlockSize()
Description copied from class:BlockStoreReturns the size of the blocks managed through the block store.- Specified by:
getBlockStoreBlockSizein classBlockStore
-
releaseBuffer
protected void releaseBuffer(ByteBuffer buffer)
Description copied from class:BlockStoreReleases a mmap-ed buffer, which you are sure won't be used again- Specified by:
releaseBufferin classBlockStore- Parameters:
buffer- the buffer
-
-