Proto Reader
Reads and decodes protocol message fields.
Functions
Store an already read field temporarily. Once the entire message is read, call endMessageAndGetUnknownFields to retrieve unknown fields.
Begin a nested message. A call to this method will restrict the reader so that nextTag returns -1 when the message is complete. An accompanying call to endMessage must then occur with the opaque token returned from this method.
End a length-delimited nested message. Calls to this method must be symmetric with calls to beginMessage.
Reads each tag, handles it, and returns a byte string with the unknown fields.
Returns the min length of the next field in bytes. Some encodings have a fixed length, while others have a variable length. LENGTH_DELIMITED fields have a known variable length, while VARINT fields could be as small as a single byte.
Reads and returns the length of the next message in a length-delimited stream.
Reads and returns the next tag of the message, or -1 if there are no further tags. Use peekFieldEncoding after calling this method to query its encoding. This silently skips groups.
Returns the encoding of the next field value. nextTag must be called before this method.
Reads a 32-bit little-endian integer from the stream.
Reads a 64-bit little-endian integer from the stream.
Reads a string
field value from the stream.
Read an unknown field and store temporarily. Once the entire message is read, call endMessageAndGetUnknownFields to retrieve unknown fields.
Reads a raw varint from the stream. If larger than 32 bits, discard the upper bits.
Reads a raw varint up to 64 bits in length from the stream.