Allow multiple gzip members in gzip streams.

We look for the gzip magic bytes at the end of every
member and try to decompress the remainder of the
stream if we find it.

Note that this changes the behaviour of this class wrt.
the underlying stream: It is no longer self limiting. It
will attempt to read past the gzip trailer to look for
more data to decompress. Before this change, it would've
been possible to (hackily) consume the rest of the compressed
stream directly by inspecting the value of
InflaterInputStream.inf.getRemainingBytes(). It's no longer
possible to sensibly support that.

bug: https://code.google.com/p/android/issues/detail?id=63873

Change-Id: I818f77c052a811ed98b76243f2ad8a1a4d236d70
3 files changed