Problems in Deserialization after decompression
-
Hi, I have very peculiar problem regarding GZipStream class under System.IO.Compresion namespace. The problem is like this: I have an ArrayList with large amount of data. I want to serialize it after compressing it. I used the following algorithm: 1. Create a MemoryStream 2. Serialize the ArrayList into that stream. 3. Compress the memorystream 4. Write the compressed stream into a file. this runs ok without any error. but problems occur when I want to deserialize it after decompression as follows: 1. Create a file stream from the file. 2. Decompress it into a memorystream 3. Deserialize the stream into an ArrayList exception is thrown here, it say somesort of like this: Binary header broken cannot deserialize from the stream. This is a peculiar problem, the compression process is not reversible! I don't know how to get rid of this problem. Anyone please help me. Thank's in advance....... With regards, Anindya Chatterjee