B bamelyan Jul 3, 2009 #1 Is there a way to determine wether a MemoryStream is compressed, i.e. needs to be decompressed with GZipStream?
Is there a way to determine wether a MemoryStream is compressed, i.e. needs to be decompressed with GZipStream?
A Arne Vajhøj Jul 3, 2009 #2 bamelyan said: Is there a way to determine wether a MemoryStream is compressed, i.e. needs to be decompressed with GZipStream? Click to expand... Not really. Bytes are just bytes. If the first 3 bytes are 0x1f 0x8b 0x08 then there is a decent chance it is gzipped. Arne
bamelyan said: Is there a way to determine wether a MemoryStream is compressed, i.e. needs to be decompressed with GZipStream? Click to expand... Not really. Bytes are just bytes. If the first 3 bytes are 0x1f 0x8b 0x08 then there is a decent chance it is gzipped. Arne
B bamelyan Jul 3, 2009 #3 thanks for quick response. what's the expected behavior of GZipStream if i try to decompress a stream that is not compressed?
thanks for quick response. what's the expected behavior of GZipStream if i try to decompress a stream that is not compressed?
A Arne Vajhøj Jul 4, 2009 #4 bamelyan said: thanks for quick response. what's the expected behavior of GZipStream if i try to decompress a stream that is not compressed? Click to expand... I think one of two will happen: * if the data just happens to be a valid GZIP format then you will get absolute garbage * else (and that is by far the most likely) then you will get a InvalidDataException Arne
bamelyan said: thanks for quick response. what's the expected behavior of GZipStream if i try to decompress a stream that is not compressed? Click to expand... I think one of two will happen: * if the data just happens to be a valid GZIP format then you will get absolute garbage * else (and that is by far the most likely) then you will get a InvalidDataException Arne