I'm working with an arbitrary array of bytes which contains two raw DEFLATE streams concatenated. There is no metadata that tells where the first stream ends or the next one begins. Is there a way to decompress the first stream and know where it ended so that I may decompress the next stream?
The .NET DeflateStream
does not provide information about how many bytes were consumed in decompression. The Length
and Position
properties are not supported. I've been told that the BaseStream
will always be fully consumed, not just up to the end of the DEFLATE stream. I've found the following questions relevant, but not helpful:
DeflateStream advancing underlying stream to end
How to advance past a deflate byte sequence contained in a byte stream?
Is there a better library out there? Is there an algorithm to step through and find the end of the stream? Any help is appreciated.