commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C. Grobmeier" <>
Subject Re: [compress] Discussing compress
Date Tue, 14 Feb 2006 16:29:49 GMT
Hello again :-)

> How do you change a file?

Replacement would be not so good. I think a modify is a: delete and add 

> How do you delete a file and shrink the archive?

I thought about reading the zip spec and cutting out the bytes i don't 

> And all this heavily depends on the used compression type. So you might
> have to implement this for zip/jar/tar - ok - I know tar is not a
> compressed archive - but its a archive where it might be nice to have
> write support for.

Yes, of course i would have to read the spec of tar, bzip2 etc.
Hope i didn't miss your point.

>> I found out that i possibly can use RandomAccessFile and read byte for
>> byte and write in back to the same file at the same time.
> Sure, but you have to write a compressed stream.

Does that matter? Byte is a Byte is a Byte, i would daresay. At the 
moment i don't want to reimplement the compressing algorithms but want 
to extend the Zip-API.

>> This may lead to a corruption of the source file when the operation is
>> interrupted, but is fastest.
> This is bad, isnt it?

haha ok, ok you are right this is bad. Don't know why i was thinking 
about it seriously :)

>> I could read the file as a stream and write the needed bytes as
>> output-stream in another temp-file which has to be mv'd to the source
>> after finished. That would be fast and quite secure. But i need a
>> tempfolder where something can get wrong.
>> The issue with decompressing to a temp-folder and compressing it again:
>> I think it would be faster if i could manipulate the bytes directly.
>> And what if the temp-folder is beeing manipulated while the operation
>> runs? What if the zipfile is huge so space in the temp-folder runs out?
> throw new IOException() ;-)

Ok, lets make it easy ;-)
Thanks for your help, this is very motivating.


> Ciao,
> Mario
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message