commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [compress] Discussing compress
Date Tue, 14 Feb 2006 16:40:24 GMT
Hi!
>> How do you change a file?
>
> Replacement would be not so good. I think a modify is a: delete and
> add operation.
ok

>> 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.
I am not aware of a file operation which allows you to cut out a number
of bytes from a file. I think there exists a "cut from end", but AFAIK
this is not available in java, nor is it available with filesystems like
webdav, ftp or cifs.
I hoped compress will be able to write to files on those filesystems too
(with the help of VFS for sure :-) )

>>> 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.
Your RandomAccessFile directly manipulates the archive, no?
So when you change bytes they have to follow the spec.
so if you archive looks like: asldkjg which represents the text
"compress is super duper" your RandomAccessFile only sees the bytes
"asldkjg"
now if you change "compress is super duper" to "compress is duper super"
the bytes might look like "asuriz"

This is very simplified, you have to manage a directory structure too.

If you manage to do that, than I'll salut you ;-)


---
Mario


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