poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BURY Laurent ROSI/SICOR" <laurent.b...@francetelecom.com>
Subject Corrupted Office format by POI when embedded objects in Office file ???
Date Thu, 09 Jun 2005 09:58:02 GMT

I have a problem of data corruption if the Office file I want to modify
an embedded object:

once I saved it (even unmodified !!!) using the
POIFSFileSystem.writeFilesystem(modifiedStream) method, POI is non longer
to reopen it without sending an error:

java.io.IOException: block[ 0 ] already removed
at org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:96)
at org.apache.poi.poifs.storage.BlockAllocationTableReader
at org.apache.poi.poifs.storage.BlockListImpl
at org.apache.poi.poifs.filesystem.POIFSFileSystem
at org.apache.poi.poifs.filesystem

I don't have this problem if there is no embedded object in the Office file.

Here is my (short) java code:

//Retrieving the stream from the office file into POI...
fs = new POIFSFileSystem(sourceStream);
ByteArrayOutputStream modifiedStream = new ByteArrayOutputStream();
//Retrieving (unmodified) stream from POI...now content is corrupted !

I wonder if POI is able to correctly manage this kind of files ???

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message