Class GZIPDecoder

java.lang.Object
org.archive.format.gzip.GZIPDecoder
All Implemented Interfaces:
GZIPConstants

public class GZIPDecoder extends Object implements GZIPConstants
  • Field Details

  • 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

      public long alignOnMagic3(InputStream is) throws IOException
      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

    • parseHeader

      public GZIPHeader parseHeader(InputStream origIn, boolean assume1st3) throws GZIPFormatException, IOException
      Throws:
      GZIPFormatException
      IOException