Class GzipInflatingBuffer.GzipMetadataReader
java.lang.Object
io.grpc.internal.GzipInflatingBuffer.GzipMetadataReader
- Enclosing class:
GzipInflatingBuffer
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 -
Method Summary
Modifier and TypeMethodDescriptionprivate intprivate booleanSkip over a zero-terminated byte sequence.private intReturns the next unsigned byte, adding it the CRC and incrementingbytesConsumed.private longReads unsigned integer in Little-Endian byte order.private intReads unsigned short in Little-Endian byte order.private voidskipBytes(int length) Skipslengthbytes, adding them to the CRC and addinglengthtobytesConsumed.
-
Constructor Details
-
GzipMetadataReader
private GzipMetadataReader()
-
-
Method Details
-
readUnsignedByte
private int readUnsignedByte()Returns the next unsigned byte, adding it the CRC and incrementingbytesConsumed.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) Skipslengthbytes, adding them to the CRC and addinglengthtobytesConsumed.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.
-