org.apache.poi.poifs.storage
Class RawDataBlockList

java.lang.Object
  |
  +--org.apache.poi.poifs.storage.BlockListImpl
        |
        +--org.apache.poi.poifs.storage.RawDataBlockList
All Implemented Interfaces:
BlockList

public class RawDataBlockList
extends org.apache.poi.poifs.storage.BlockListImpl

A list of RawDataBlocks instances, and methods to manage the list

Author:
Marc Johnson (mjohnson at apache dot org

Constructor Summary
RawDataBlockList(java.io.InputStream stream)
          Constructor RawDataBlockList
 
Method Summary
 ListManagedBlock[] fetchBlocks(int startBlock)
          get the blocks making up a particular stream in the list.
 ListManagedBlock remove(int index)
          remove and return the specified block from the list
 void setBAT(BlockAllocationTableReader bat)
          set the associated BlockAllocationTable
protected  void setBlocks(ListManagedBlock[] blocks)
          provide blocks to manage
 void zap(int index)
          remove the specified block from the list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawDataBlockList

public RawDataBlockList(java.io.InputStream stream)
                 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

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
Specified by:
zap in interface BlockList
Parameters:
index - the index of the specified block; if the index is out of range, that's ok

remove

public ListManagedBlock remove(int index)
                        throws java.io.IOException
remove and return the specified block from the list
Specified by:
remove in interface BlockList
Parameters:
index - the index of the specified block
Returns:
the specified block
Throws:
java.io.IOException - if the index is out of range or has already been removed

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:
fetchBlocks in interface BlockList
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
Specified by:
setBAT in interface BlockList
Parameters:
bat - the associated BlockAllocationTable
Throws:
java.io.IOException -  


Copyright © 2002 Apache jakarta-poi project. All Rights Reserved.