views:

603

answers:

3

If i compress and decompress data using java then it works fine My if friend uses C#.NET to compress data while i am using java SO inthis case I can not decompress the same data.

I am using inflatter and deflater in java.

Thanks Bapi

+4  A: 

Use GZIPInputStream and GZIPOutputStream which are compatible with gzip format.

Note: each compression format is different (though similar in approach) and they have to be the same to work.

Inflator and Deflator are a cut down version of the GZIP format and I wouldn't expect it to work with anything another other than Java.

Peter Lawrey
+3  A: 

The java.util Deflator and Inflator support are the basic zip compression and decompression format implementations - they do not create a free standing archive file. Rather they create/read the data stream which corresponds to the data portion of one entry in an archive file.

To create an archive file readable by general compression utilities use either the java.util.GZIPXxx or java.util.ZipXxx classes.

Software Monkey
+1  A: 

Thanks for your support. I changed my compression logic. I used GZIPInputStream both in java and in C#.NET after this only. my problem is solved

Thanks Bapi

Deepak