Package loci.poi.poifs.storage
Class RawDataBlockList
- java.lang.Object
-
- loci.poi.poifs.storage.RawDataBlockList
-
- All Implemented Interfaces:
BlockList
public class RawDataBlockList extends java.lang.ObjectA list of RawDataBlocks instances, and methods to manage the list- Author:
- Marc Johnson (mjohnson at apache dot org
-
-
Field Summary
Fields Modifier and Type Field Description protected ListManagedBlock[]_blocks
-
Constructor Summary
Constructors Constructor Description RawDataBlockList(loci.common.RandomAccessInputStream stream, int size)Constructor RawDataBlockList
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListManagedBlock[]fetchBlocks(int startBlock)get the blocks making up a particular stream in the list.intgetBigBlockSize()ListManagedBlock[]getBlocks()ListManagedBlockremove(int index)remove and return the specified block from the listvoidsetBAT(BlockAllocationTableReader bat)set the associated BlockAllocationTableprotected voidsetBlocks(ListManagedBlock[] blocks)provide blocks to managevoidzap(int index)remove the specified block from the list
-
-
-
Field Detail
-
_blocks
protected ListManagedBlock[] _blocks
-
-
Constructor Detail
-
RawDataBlockList
public RawDataBlockList(loci.common.RandomAccessInputStream stream, int size) throws java.io.IOException
Constructor RawDataBlockList- Parameters:
stream- the InputStream from which the data will be read- Throws:
java.io.IOException- on I/O errors, and if an incomplete block is read
-
-
Method Detail
-
getBigBlockSize
public int getBigBlockSize()
-
getBlocks
public ListManagedBlock[] getBlocks()
-
setBlocks
protected void setBlocks(ListManagedBlock[] blocks)
provide blocks to manage- Parameters:
blocks- blocks to be managed
-
zap
public void zap(int index)
remove the specified block from the list
-
remove
public ListManagedBlock remove(int index) throws java.io.IOException
remove and return the specified block from the list
-
fetchBlocks
public ListManagedBlock[] fetchBlocks(int startBlock) throws java.io.IOException
get the blocks making up a particular stream in the list. The blocks are removed from the list.- Specified by:
fetchBlocksin interfaceBlockList- Parameters:
startBlock- the index of the first block in the stream- Returns:
- the stream as an array of correctly ordered blocks
- Throws:
java.io.IOException- if blocks are missing
-
setBAT
public void setBAT(BlockAllocationTableReader bat) throws java.io.IOException
set the associated BlockAllocationTable
-
-