Class GZIPDecoder
java.lang.Object
org.archive.format.gzip.GZIPDecoder
- All Implemented Interfaces:
GZIPConstants
-
Field Summary
FieldsFields inherited from interface org.archive.format.gzip.GZIPConstants
BYTES_IN_INT, BYTES_IN_SHORT, GZIP_COMPRESSION_METHOD_DEFLATE, GZIP_COMPRESSION_METHOD_IDX, GZIP_FEXTRA_LENGTH_BYTES, GZIP_FEXTRA_LENGTH_IDX, GZIP_FEXTRA_NAME_BYTES, GZIP_FEXTRA_NAME_IDX, GZIP_FEXTRA_VALUE_IDX, GZIP_FEXTRA_VALUE_MAX_LENGTH, GZIP_FLAG_FCOMMENT, GZIP_FLAG_FEXTRA, GZIP_FLAG_FHCRC, GZIP_FLAG_FNAME, GZIP_FLAG_FTEXT, GZIP_FLAG_IDX, GZIP_FLAG_VALID_BITS, GZIP_FOOTER_BYTES, GZIP_MAGIC_ONE, GZIP_MAGIC_ONE_IDX, GZIP_MAGIC_TWO, GZIP_MAGIC_TWO_IDX, GZIP_MTIME_IDX, GZIP_MTIME_LENGTH, GZIP_OS_IDX, GZIP_OS_UNIX, GZIP_STATIC_FOOTER_SIZE, GZIP_STATIC_HEADER_SIZE, GZIP_XFL_IDX, LX_RECORD, LX_RECORD_VALUE, NO_BYTES_IN_STREAM, SL_RECORD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanalignedAtEOF(long skipped) longRead bytes from InputStream argument until 3 bytes are found that appear to be the start of a GZIPHeader. leave the stream on the 4th byte, and return the number of bytes skipped before finding the 3 bytes.parseHeader(InputStream origIn) parseHeader(InputStream origIn, boolean assume1st3)
-
Field Details
-
SEARCH_EOF_AT_START
public static final long SEARCH_EOF_AT_START- See Also:
-
-
Constructor Details
-
GZIPDecoder
public GZIPDecoder() -
GZIPDecoder
public GZIPDecoder(int max) -
GZIPDecoder
public GZIPDecoder(int maxNameSize, int maxCommentSize)
-
-
Method Details
-
alignedAtEOF
public boolean alignedAtEOF(long skipped) -
alignOnMagic3
Read bytes from InputStream argument until 3 bytes are found that appear to be the start of a GZIPHeader. leave the stream on the 4th byte, and return the number of bytes skipped before finding the 3 bytes.- Parameters:
is- InputStream to read from- Returns:
- number of bytes skipped before finding the gzip magic: 0 if the first 3 bytes matched. If no magic was found before an EOF, returns the -1 * the number of bytes skipped before hitting the EOF. As a special case, if the stream was at EOF when the method is called, returns GZIPHeaderParser.SEARCH_EOF_AT_START (which is Long.MIN_VALUE)
- Throws:
IOException
-
parseHeader
- Throws:
GZIPFormatExceptionIOException
-
parseHeader
public GZIPHeader parseHeader(InputStream origIn, boolean assume1st3) throws GZIPFormatException, IOException - Throws:
GZIPFormatExceptionIOException
-