Subclass of GZIPInputStream that can handle a stream made of multiple
concatenated GZIP members/records.
This class is needed because GZIPInputStream only finds the first GZIP
member in the file even if the file is made up of multiple GZIP members.
Takes an InputStream stream that implements
RepositionableStream interface so it can backup over-reads done
by the zlib Inflater class.
Use the
GzippedInputStream.iterator() method to get a gzip member iterator.
Calls to
Iterator.next returns the next gzip member in the
stream. Cast return from
Iterator.next to InputStream.
Use
GzippedInputStream.gzipMemberSeek(long) to position stream before reading
a gzip member if doing random accessing of gzip members. Pass it offset
at which gzip member starts.
If you need to know position at which a gzip member starts, call
GzippedInputStream.position() just after a call to
Iterator.hasNext and before you call
Iterator.next .
author: stack |