Difference in file size

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Difference in file size

rsaccav@libero.it
Hi, I need some help about POI

I'm writing a class for changing one or more properties of a SummaryInfo or DocumentInfo section
I started with the CopyCompare example and I have changed it to simply binary copy all the sections in order to learn the internal logic of POI sections and property sets.

After the copy has been completed the compare of the sections return correctly that the contents of the sections copied is the same but ... why the size of the file isn't the same of the original and either if the size is the same a binary compare show many differences?

The difference in dimension is minimal (some kb) but the integrity of the contents of the file is maintained?

Another question: is it possible to change a single property without rewriting the entire file, for instance looking for the SummaryInfo file and change only the Title property?

Thanks, Raffaele
Italy



____________________________________________________________
Navighi a 4 MEGA e i primi 3 mesi sono GRATIS.
Scegli Libero Adsl Flat senza limiti su http://www.libero.it



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply | Threaded
Open this post in threaded view
|

Re: Difference in file size

Rainer Klute (Rainer Klute IT-Consulting)
Am Freitag, den 13.05.2005, 09:36 +0200 schrieb [hidden email]:
> I'm writing a class for changing one or more properties of a SummaryInfo or DocumentInfo section
> I started with the CopyCompare example and I have changed it to simply binary copy all the sections in order to learn the internal logic of POI sections and property sets.
>
> After the copy has been completed the compare of the sections return correctly that the contents of the sections copied is the same but ... why the size of the file isn't the same of the original and either if the size is the same a binary compare show many differences?
>
> The difference in dimension is minimal (some kb) but the integrity of the contents of the file is maintained?

This is normal behaviour: Copying a property set stream does generally
not produce a bitwise identical copy.


> Another question: is it possible to change a single property without rewriting the entire file, for instance looking for the SummaryInfo file and change only the Title property?

No, this is not possible. However, property sets are generally rather
lightweight and it should not present any problem to read *all* of them,
change a single one and write them *all* back to the file.

--
Best regards
Rainer Klute

                           Rainer Klute IT-Consulting GmbH
  Dipl.-Inform.
  Rainer Klute             E-Mail:  [hidden email]
  K?rner Grund 24          Telefon: +49 172 2324824
D-44143 Dortmund           Telefax: +49 231 5349423

Inhibit software patents: http://www.nosoftwarepatents.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/