jxl.write.biff
Class CompoundFile

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

final class CompoundFile
extends BaseCompoundFile

Writes out a compound file Header block is -1 Excel data is e..n (where is the head extension blocks, normally 0 and n is at least 8) Summary information (8 blocks) Document summary (8 blocks) BBD is block p..q (where p=e+n+16 and q-p+1 is the number of BBD blocks) Property storage block is q+b...r (normally 1 block) (where b is the number of BBD blocks)


Inner classes inherited from class jxl.biff.BaseCompoundFile
BaseCompoundFile.PropertyStorage
 
Field Summary
private  int bbdPos
          The current position within the bbd.
private  int bbdStartBlock
          The start block of the big block depot
private  byte[] bigBlockDepot
          The current bbd block
private  byte[] excelData
          The organized biff records which form the actual excel data
private  int excelDataBlocks
          The number of blocks it takes to store the excel data
private  int excelDataStartBlock
          The start block of the excel data
private  int extensionBlock
          The extension block for the header
private  int numBigBlockDepotBlocks
          The number of blocks it takes to store the big block depot
private  int numExtensionBlocks
          The number of extension blocks required for the header to describe the BBD
private  java.io.OutputStream out
          The stream to which the jumbled up data is written to
private  int requiredSize
          The size the excel data should be in order to comply with the general compound file format
private  int rootStartBlock
          The start block of the root entry
private  int size
          The size of the array
 
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[] data, int l, java.io.OutputStream os)
          Constructor
 
Method Summary
private  void checkBbdPos()
          Checks that the data can fit into the current BBD block.
 void write()
          Writes out the excel file in OLE compound file format
private  void writeBigBlockDepot()
          Writes out the Big Block Depot
private  void writeExcelData()
          Writes out the excel data, padding it out with empty bytes as necessary
private  void writeHeader()
          Writes the compound file header
private  void writePropertySets()
          Writes out the property sets
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

out

private java.io.OutputStream out
The stream to which the jumbled up data is written to

excelData

private byte[] excelData
The organized biff records which form the actual excel data

size

private int size
The size of the array

requiredSize

private int requiredSize
The size the excel data should be in order to comply with the general compound file format

numBigBlockDepotBlocks

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

numExtensionBlocks

private int numExtensionBlocks
The number of extension blocks required for the header to describe the BBD

extensionBlock

private int extensionBlock
The extension block for the header

excelDataBlocks

private int excelDataBlocks
The number of blocks it takes to store the excel data

rootStartBlock

private int rootStartBlock
The start block of the root entry

excelDataStartBlock

private int excelDataStartBlock
The start block of the excel data

bbdStartBlock

private int bbdStartBlock
The start block of the big block depot

bbdPos

private int bbdPos
The current position within the bbd. Used when writing out the BBD

bigBlockDepot

private byte[] bigBlockDepot
The current bbd block
Constructor Detail

CompoundFile

public CompoundFile(byte[] data,
                    int l,
                    java.io.OutputStream os)
Constructor
Parameters:
l - the length of the data
os - the output stream to write to
data - the excel data
Method Detail

write

public void write()
           throws java.io.IOException
Writes out the excel file in OLE compound file format
Throws:
java.io.IOException -  

writeExcelData

private void writeExcelData()
                     throws java.io.IOException
Writes out the excel data, padding it out with empty bytes as necessary
Throws:
java.io.IOException -  

writeHeader

private void writeHeader()
                  throws java.io.IOException
Writes the compound file header
Throws:
java.io.IOException -  

checkBbdPos

private void checkBbdPos()
                  throws java.io.IOException
Checks that the data can fit into the current BBD block. If not, then it moves on to the next block
Throws:
java.io.IOException -  

writeBigBlockDepot

private void writeBigBlockDepot()
                         throws java.io.IOException
Writes out the Big Block Depot
Throws:
java.io.IOException -  

writePropertySets

private void writePropertySets()
                        throws java.io.IOException
Writes out the property sets
Throws:
java.io.IOException -