J# Zip Class Question

B

BuddyWork

Do you know or have any examples on how to get
ZipOutputStream/ZipInputStream classes so it can
compress/uncompress without writing to a file, I
basically want to pass in a string so it gets compressed
by either using GZip or Zip, then I want to pass in the
compression string and uncompress it either by using GZip
or Zip?
 
W

Wiktor Zychla

Do you know or have any examples on how to get
ZipOutputStream/ZipInputStream classes so it can
compress/uncompress without writing to a file, I
basically want to pass in a string so it gets compressed
by either using GZip or Zip, then I want to pass in the
compression string and uncompress it either by using GZip
or Zip?

I think that you should use Inflater/Deflater classes to actually compress
data.

The ZipOutputStream/ZipInputStream are helper classes to manage zip files.
And as far as I know ZipOutputStream/ZipInputStream use Inflater/Deflater
internally.

Regards,
Wiktor
 
B

BuddyWork

Hello Wiktor,

Thanks for the reply, I was originally using
Inflator/Deflator classes but then don't seem to use the
ZIP/GZIP compression, basically when I was passing in the
zip compression data it basically threw an exception
stating invalid format.

I've looked at the code and found that the
ZipOutputStream/ZipInputStream uses
InflatedInputStream/DelatorOutputStream class which does
not use Inflator/Delator classes.

I'm I missing something.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top