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 java.io.InputStream |
originalIn |
crc, eos, FCOMMENT, FEXTRA, FHCRC, FNAME, FTEXT, GZIP_MAGICbuf, inf, len, usesDefaultInflater| Constructor and Description |
|---|
GZIPMembersInputStream(java.io.InputStream in) |
GZIPMembersInputStream(java.io.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 java.io.InputStream |
countingStream(java.io.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.
|
java.util.zip.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.
|
java.util.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, skipprotected long memberNumber
protected long holdAtMemberNumber
protected long currentMemberStart
protected long currentMemberEnd
protected java.io.InputStream originalIn
public GZIPMembersInputStream(java.io.InputStream in)
throws java.io.IOException
java.io.IOExceptionpublic GZIPMembersInputStream(java.io.InputStream in,
int size)
throws java.io.IOException
java.io.IOExceptionprotected static java.io.InputStream countingStream(java.io.InputStream in,
int lookback)
throws java.io.IOException
in - stream to wraplookback - tolerance of initial markjava.io.IOExceptionprotected void updateInnerMark()
public int read(byte[] buf,
int off,
int len)
throws java.io.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 readjava.util.zip.ZipException - if the compressed input data is corrupt.java.io.IOException - if an I/O error has occurred.protected boolean readTrailer()
throws java.io.IOException
readTrailer in class OpenJDK7GZIPInputStreamjava.io.IOExceptionpublic void compressedSeek(long position)
throws java.io.IOException
position - target positionjava.io.IOExceptionpublic void compressedSkip(long offset)
throws java.io.IOException
offset - bytes to skipjava.io.IOExceptionjava.io.EOFExceptionprotected void startNewMember()
throws java.io.IOException
java.io.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 java.util.zip.Inflater getInflater()
public java.util.Iterator<GZIPMembersInputStream> memberIterator()
Copyright © 2019 The International Internet Preservation Consortium. All Rights Reserved.