org.apache.poi.poifs.storage
Class SmallBlockTableWriter

java.lang.Object
  extended by org.apache.poi.poifs.storage.SmallBlockTableWriter
All Implemented Interfaces:
BATManaged, BlockWritable

public class SmallBlockTableWriter
extends java.lang.Object
implements BlockWritable, BATManaged

This class implements storage for writing the small blocks used by small documents.

Author:
Marc Johnson (mjohnson at apache dot org)

Constructor Summary
SmallBlockTableWriter(POIFSBigBlockSize bigBlockSize, java.util.List documents, RootProperty root)
          Creates new SmallBlockTable
 
Method Summary
 int countBlocks()
          Return the number of BigBlock's this instance uses
 BlockAllocationTableWriter getSBAT()
          Get the SBAT
 int getSBATBlockCount()
          Get the number of SBAT blocks
 void setStartBlock(int start_block)
          Set the start block for this instance
 void writeBlocks(java.io.OutputStream stream)
          Write the storage to an OutputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmallBlockTableWriter

public SmallBlockTableWriter(POIFSBigBlockSize bigBlockSize,
                             java.util.List documents,
                             RootProperty root)
Creates new SmallBlockTable

Parameters:
documents - a List of POIFSDocument instances
root - the Filesystem's root property
Method Detail

getSBATBlockCount

public int getSBATBlockCount()
Get the number of SBAT blocks

Returns:
number of SBAT big blocks

getSBAT

public BlockAllocationTableWriter getSBAT()
Get the SBAT

Returns:
the Small Block Allocation Table

countBlocks

public int countBlocks()
Return the number of BigBlock's this instance uses

Specified by:
countBlocks in interface BATManaged
Returns:
count of BigBlock instances

setStartBlock

public void setStartBlock(int start_block)
Set the start block for this instance

Specified by:
setStartBlock in interface BATManaged
Parameters:
start_block -

writeBlocks

public void writeBlocks(java.io.OutputStream stream)
                 throws java.io.IOException
Write the storage to an OutputStream

Specified by:
writeBlocks in interface BlockWritable
Parameters:
stream - the OutputStream to which the stored data should be written
Throws:
java.io.IOException - on problems writing to the specified stream


Copyright 2012 The Apache Software Foundation or its licensors, as applicable.