boolean objectPoolWritten = false;
boolean tableWritten = false;
boolean propertiesWritten = false;
for ( Iterator<Entry> iter = directory.getEntries(); iter.hasNext(); )
{
Entry entry = iter.next();
if ( entry.getName().equals( STREAM_WORD_DOCUMENT ) )
{
if ( !docWritten )
{
pfs.createDocument( new ByteArrayInputStream( mainBuf ),
STREAM_WORD_DOCUMENT );
docWritten = true;
}
}
else if ( entry.getName().equals( STREAM_OBJECT_POOL ) )
{
if ( !objectPoolWritten )
{
_objectPool.writeTo( pfs.getRoot() );
objectPoolWritten = true;
}
}
else if ( entry.getName().equals( STREAM_TABLE_0 )
|| entry.getName().equals( STREAM_TABLE_1 ) )
{
if ( !tableWritten )
{
pfs.createDocument( new ByteArrayInputStream( tableBuf ),
STREAM_TABLE_1 );
tableWritten = true;
}
}
else if ( entry.getName().equals(
SummaryInformation.DEFAULT_STREAM_NAME )
|| entry.getName().equals(
DocumentSummaryInformation.DEFAULT_STREAM_NAME ) )
{
if ( !propertiesWritten )
{
writeProperties( pfs );
propertiesWritten = true;
}
}
else if ( entry.getName().equals( STREAM_DATA ) )
{
if ( !dataWritten )
{
pfs.createDocument( new ByteArrayInputStream( dataBuf ),
STREAM_DATA );