Package io.grpc.internal
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 int
private boolean
Skip over a zero-terminated byte sequence.private int
Returns the next unsigned byte, adding it the CRC and incrementingbytesConsumed
.private long
Reads unsigned integer in Little-Endian byte order.private int
Reads unsigned short in Little-Endian byte order.private void
skipBytes
(int length) Skipslength
bytes, adding them to the CRC and addinglength
tobytesConsumed
.
-
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) Skipslength
bytes, adding them to the CRC and addinglength
tobytesConsumed
.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.
-