Class GzipInflatingBuffer.GzipMetadataReader

java.lang.Object
io.grpc.internal.GzipInflatingBuffer.GzipMetadataReader
Enclosing class:
GzipInflatingBuffer

private class GzipInflatingBuffer.GzipMetadataReader extends 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 Details

    • GzipMetadataReader

      private GzipMetadataReader()
  • Method Details

    • 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.