public class GZIPMembersInputStream extends OpenJDK7GZIPInputStream
| Modifier and Type | Class and Description |
|---|---|
class |
GZIPMembersInputStream.GZIPEnvelopeIterator
Provides iterator-ish interface to members in a concatenated multi-member
GZIP stream for backward compatibility with our prior workaround.
|
| Modifier and Type | Field and Description |
|---|---|
protected long |
currentMemberEnd |
protected long |
currentMemberStart |
protected long |
holdAtMemberNumber |
protected long |
memberNumber |
protected InputStream |
originalIn |
crc, eos, FCOMMENT, FEXTRA, FHCRC, FNAME, FTEXT, GZIP_MAGICbuf, inf, len, usesDefaultInflaterin| Constructor and Description |
|---|
GZIPMembersInputStream(InputStream in) |
GZIPMembersInputStream(InputStream in,
int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
compressedSeek(long position)
Seek forward to a particular offset in the compressed stream.
|
void |
compressedSkip(long offset)
Skip forward the given number of bytes in the compressed stream.
|
protected static InputStream |
countingStream(InputStream in,
int lookback)
A CountingInputStream is inserted to read compressed-offsets.
|
boolean |
getAtMemberEnd()
Test whether last read resulted in reaching the exact end of one GZIP
member.
|
long |
getCurrentMemberEnd()
Get the compressed offset where the current, just-completed member
ends.
|
long |
getCurrentMemberStart()
Get the compressed offset where the current member began.
|
Inflater |
getInflater()
Helpful for testing/debugging
|
long |
getMemberNumber()
Get the ordinal number, starting at zero, of the currently-being-read
GZIP member, counting from the creation of this stream.
|
Iterator<GZIPMembersInputStream> |
memberIterator()
Deprecated.
for backward compatibility; better to use direct facilities in future
|
void |
nextMember()
Advance to next member (if the stream has been set to return EOF at the
end of each member).
|
int |
read(byte[] buf,
int off,
int len)
Reads uncompressed data into an array of bytes.
|
protected boolean |
readTrailer() |
void |
setEofEachMember(boolean eofPerMember)
Set stream behavior to match JDK 6u22-and-earlier behavior, where
reaching the end of any one GZIP member results in EOFs from all
read()s as if no more data is available.
|
protected void |
startNewMember() |
protected void |
updateInnerMark() |
close, readHeader, readUByte, readUInt, readUShort, skipBytesavailable, fill, mark, markSupported, read, reset, skipreadprotected long memberNumber
protected long holdAtMemberNumber
protected long currentMemberStart
protected long currentMemberEnd
protected InputStream originalIn
public GZIPMembersInputStream(InputStream in) throws IOException
IOExceptionpublic GZIPMembersInputStream(InputStream in, int size) throws IOException
IOExceptionprotected static InputStream countingStream(InputStream in, int lookback) throws IOException
in - stream to wraplookback - tolerance of initial markIOExceptionprotected void updateInnerMark()
public int read(byte[] buf,
int off,
int len)
throws IOException
OpenJDK7GZIPInputStreamlen is not
zero, the method will block until some input can be decompressed; otherwise,
no bytes are read and 0 is returned.read in class OpenJDK7GZIPInputStreambuf - the buffer into which the data is readoff - the start offset in the destination array blen - the maximum number of bytes readZipException - if the compressed input data is corrupt.IOException - if an I/O error has occurred.protected boolean readTrailer()
throws IOException
readTrailer in class OpenJDK7GZIPInputStreamIOExceptionpublic void compressedSeek(long position)
throws IOException
position - target positionIOExceptionpublic void compressedSkip(long offset)
throws IOException
offset - bytes to skipIOExceptionEOFExceptionprotected void startNewMember()
throws IOException
IOExceptionpublic boolean getAtMemberEnd()
public long getMemberNumber()
public long getCurrentMemberStart()
public long getCurrentMemberEnd()
public void setEofEachMember(boolean eofPerMember)
eofPerMember - true to set EOF-each-member behaviorpublic void nextMember()
public Inflater getInflater()
public Iterator<GZIPMembersInputStream> memberIterator()
Copyright © 2015 The International Internet Preservation Consortium. All Rights Reserved.