Class GzipInflatingBuffer.GzipMetadataReader

  • Enclosing class:
    GzipInflatingBuffer

    private class GzipInflatingBuffer.GzipMetadataReader
    extends java.lang.Object
    Reads gzip header and trailer bytes from the inflater's buffer (if bytes beyond the inflate block were given to the inflater) and then from gzippedData, and handles updating the CRC and the count of gzipped bytes consumed.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private GzipMetadataReader()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private int readableBytes()  
      private boolean readBytesUntilZero()
      Skip over a zero-terminated byte sequence.
      private int readUnsignedByte()
      Returns the next unsigned byte, adding it the CRC and incrementing bytesConsumed.
      private long readUnsignedInt()
      Reads unsigned integer in Little-Endian byte order.
      private int readUnsignedShort()
      Reads unsigned short in Little-Endian byte order.
      private void skipBytes​(int length)
      Skips length bytes, adding them to the CRC and adding length to bytesConsumed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GzipMetadataReader

        private GzipMetadataReader()
    • Method Detail

      • readUnsignedByte

        private int readUnsignedByte()
        Returns the next unsigned byte, adding it the CRC and incrementing bytesConsumed.

        It is the responsibility of the caller to verify and reset the CRC as needed, as well as caching the current CRC value when necessary before invoking this method.

      • skipBytes

        private void skipBytes​(int length)
        Skips length bytes, adding them to the CRC and adding length to bytesConsumed.

        It is the responsibility of the caller to verify and reset the CRC as needed, as well as caching the current CRC value when necessary before invoking this method.

      • readableBytes

        private int readableBytes()
      • readBytesUntilZero

        private boolean readBytesUntilZero()
        Skip over a zero-terminated byte sequence. Returns true when the zero byte is read.
      • readUnsignedShort

        private int readUnsignedShort()
        Reads unsigned short in Little-Endian byte order.
      • readUnsignedInt

        private long readUnsignedInt()
        Reads unsigned integer in Little-Endian byte order.