M
Mohun Biswas
I have a FileOutputStream which I wrap with a GZIPOutputStream, just as
described in the documentation. Thus I'm reading uncompressed data from
a stream and writing it in compressed form. This works fine, but I also
need a CRC of the (uncompressed) data. I'd hate to have to read the data
twice, once for the CRC and then again to compress it. What I want to do
is hook a java.util.zip.CRC32 object into the "pipe" in a way that lets
it accumulate CRC data as the data streams by into the GZIPOutputStream.
Can anyone give me the rough outline of how this is done?
described in the documentation. Thus I'm reading uncompressed data from
a stream and writing it in compressed form. This works fine, but I also
need a CRC of the (uncompressed) data. I'd hate to have to read the data
twice, once for the CRC and then again to compress it. What I want to do
is hook a java.util.zip.CRC32 object into the "pipe" in a way that lets
it accumulate CRC data as the data streams by into the GZIPOutputStream.
Can anyone give me the rough outline of how this is done?