jxl.read.biff
Class CompoundFile

java.lang.Object
  |
  +--jxl.biff.BaseCompoundFile
        |
        +--jxl.read.biff.CompoundFile

public final class CompoundFile
extends BaseCompoundFile

Reads in and defrags an OLE compound compound file (Made public only for the PropertySets demo)


Inner classes inherited from class jxl.biff.BaseCompoundFile
BaseCompoundFile.PropertyStorage
 
Field Summary
private  int[] bigBlockChain
          The sequence of blocks which comprise the big block chain
private  int[] bigBlockDepotBlocks
          The chain of blocks which comprise the big block depot
private  byte[] data
          The original OLE stream, organized into blocks, which can appear at any physical location in the file
private  int extensionBlock
          The header extension block
private  int numBigBlockDepotBlocks
          The number of blocks it takes to store the big block depot
private  int numExtensionBlocks
          The number of header extension blocks
private  java.util.ArrayList propertySets
          The list of property sets
private  byte[] rootEntry
          The root entry
private  int rootStartBlock
          The start block of the root entry
private  int sbdStartBlock
          The start block of the small block depot
private  int[] smallBlockChain
          The sequence of blocks which comprise the small block chain
 
Fields inherited from class jxl.biff.BaseCompoundFile
BIG_BLOCK_DEPOT_BLOCKS_POS, BIG_BLOCK_SIZE, DIRECTORY_POS, EXTENSION_BLOCK_POS, identifier, NEXT_POS, NUM_BIG_BLOCK_DEPOT_BLOCKS_POS, NUM_EXTENSION_BLOCK_POS, PREVIOUS_POS, PROPERTY_STORAGE_BLOCK_SIZE, ROOT_START_BLOCK_POS, SIZE_OF_NAME_POS, SIZE_POS, SMALL_BLOCK_DEPOT_BLOCK_POS, SMALL_BLOCK_SIZE, SMALL_BLOCK_THRESHOLD, START_BLOCK_POS, TYPE_POS
 
Constructor Summary
CompoundFile(byte[] d)
          Initializes the compound file
 
Method Summary
private  byte[] getBigBlockStream(BaseCompoundFile.PropertyStorage ps)
          Build up the resultant stream using the big blocks
 java.lang.String[] getPropertySetNames()
          Gets the property sets
private  BaseCompoundFile.PropertyStorage getPropertyStorage(java.lang.String name)
          Gets the property set with the specified name
private  byte[] getSmallBlockStream(BaseCompoundFile.PropertyStorage ps)
          Build up the resultant stream using the small blocks
 byte[] getStream(java.lang.String streamName)
          Gets the defragmented stream from this ole compound file
private  void readBigBlockDepot()
          Reads the big block depot entries
private  byte[] readData(int bl)
          Reads the block chain from the specified block and returns the data as a continuous stream of bytes
private  void readPropertySets()
          Reads all the property sets
private  void readSmallBlockDepot()
          Reads the small block depot entries
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

data

private byte[] data
The original OLE stream, organized into blocks, which can appear at any physical location in the file

numBigBlockDepotBlocks

private int numBigBlockDepotBlocks
The number of blocks it takes to store the big block depot

sbdStartBlock

private int sbdStartBlock
The start block of the small block depot

rootStartBlock

private int rootStartBlock
The start block of the root entry

extensionBlock

private int extensionBlock
The header extension block

numExtensionBlocks

private int numExtensionBlocks
The number of header extension blocks

rootEntry

private byte[] rootEntry
The root entry

bigBlockChain

private int[] bigBlockChain
The sequence of blocks which comprise the big block chain

smallBlockChain

private int[] smallBlockChain
The sequence of blocks which comprise the small block chain

bigBlockDepotBlocks

private int[] bigBlockDepotBlocks
The chain of blocks which comprise the big block depot

propertySets

private java.util.ArrayList propertySets
The list of property sets
Constructor Detail

CompoundFile

public CompoundFile(byte[] d)
             throws BiffException
Initializes the compound file
Parameters:
d - the raw data of the ole stream
Method Detail

readBigBlockDepot

private void readBigBlockDepot()
Reads the big block depot entries

readSmallBlockDepot

private void readSmallBlockDepot()
Reads the small block depot entries

readPropertySets

private void readPropertySets()
Reads all the property sets

getStream

public byte[] getStream(java.lang.String streamName)
                 throws BiffException
Gets the defragmented stream from this ole compound file
Parameters:
streamName - the stream name to get
Returns:
the defragmented ole stream

getPropertyStorage

private BaseCompoundFile.PropertyStorage getPropertyStorage(java.lang.String name)
                                                     throws BiffException
Gets the property set with the specified name

getBigBlockStream

private byte[] getBigBlockStream(BaseCompoundFile.PropertyStorage ps)
Build up the resultant stream using the big blocks
Parameters:
ps - the property storage
Returns:
the big block stream

getSmallBlockStream

private byte[] getSmallBlockStream(BaseCompoundFile.PropertyStorage ps)
                            throws BiffException
Build up the resultant stream using the small blocks

readData

private byte[] readData(int bl)
Reads the block chain from the specified block and returns the data as a continuous stream of bytes

getPropertySetNames

public java.lang.String[] getPropertySetNames()
Gets the property sets
Returns:
the list of property sets