Magic-detection in unseekable streams
If you have a stream of GZip compressed data, you can wrap the stream object in a deflating GZipStream. But how do you decide whether to wrap a stream in a deflating stream? And how do you identify encoding while also handing over the full untouched stream to the decoder?