got it, thanks Stefan
On Tue, Mar 29, 2011 at 9:05 PM, Stefan Bodewig <[email protected]> wrote: > On 2011-03-30, Alexander Gubin wrote: > >> Does commons-compress support appending to compressed files? > > In general the compression formats don't support appending. > > Many algorithms are block based (bzip is one) and if your original > data's length isn't an exact multiple of the block size (which in > general it is not) the final block must be marked in some way and will > be padded. > > If you append to such a file any tool reading the compressed file will > see the marked block and stop extracting there - not seeing the data > you've appended ever. > > The only proper way append could work was by reading the original stream > and writing it again compressing but not closing it. This can not be > done by simply making the OutputStream one that was opened in some sort > of append mode. > > Stefan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
