commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C. Grobmeier" <grobme...@possessed.de>
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 
operation.

> 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 
need.

> 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.

Christian

> 
> Ciao,
> Mario
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message