Public Member Functions | |
void | checkLastTagWas (final int value) throws InvalidProtocolBufferException |
void | enableAliasing (boolean enabled) |
int | getBytesUntilLimit () |
int | getLastTag () |
int | getTotalBytesRead () |
boolean | isAtEnd () throws IOException |
void | popLimit (final int oldLimit) |
int | pushLimit (int byteLimit) throws InvalidProtocolBufferException |
boolean | readBool () throws IOException |
byte[] | readByteArray () throws IOException |
ByteBuffer | readByteBuffer () throws IOException |
ByteString | readBytes () throws IOException |
double | readDouble () throws IOException |
int | readEnum () throws IOException |
int | readFixed32 () throws IOException |
long | readFixed64 () throws IOException |
float | readFloat () throws IOException |
void | readGroup (final int fieldNumber, final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException |
int | readInt32 () throws IOException |
long | readInt64 () throws IOException |
void | readMessage (final MessageLite.Builder builder, final ExtensionRegistryLite extensionRegistry) throws IOException |
byte | readRawByte () throws IOException |
byte[] | readRawBytes (final int length) throws IOException |
int | readRawLittleEndian32 () throws IOException |
long | readRawLittleEndian64 () throws IOException |
int | readRawVarint32 () throws IOException |
long | readRawVarint64 () throws IOException |
int | readSFixed32 () throws IOException |
long | readSFixed64 () throws IOException |
int | readSInt32 () throws IOException |
long | readSInt64 () throws IOException |
String | readString () throws IOException |
String | readStringRequireUtf8 () throws IOException |
int | readTag () throws IOException |
int | readUInt32 () throws IOException |
long | readUInt64 () throws IOException |
void | readUnknownGroup (final int fieldNumber, final MessageLite.Builder builder) throws IOException |
void | resetSizeCounter () |
boolean | skipField (final int tag) throws IOException |
boolean | skipField (final int tag, final CodedOutputStream output) throws IOException |
void | skipMessage () throws IOException |
void | skipMessage (CodedOutputStream output) throws IOException |
void | skipRawBytes (final int length) throws IOException |
![]() | |
final int | setRecursionLimit (final int limit) |
final int | setSizeLimit (final int limit) |
Private Member Functions | |
int | bufferPos (long pos) |
void | recomputeBufferSizeAfterLimit () |
int | remaining () |
void | skipRawVarint () throws IOException |
void | skipRawVarintFastPath () throws IOException |
void | skipRawVarintSlowPath () throws IOException |
ByteBuffer | slice (long begin, long end) throws IOException |
UnsafeDirectNioDecoder (ByteBuffer buffer, boolean immutable) | |
Private Attributes | |
final long | address |
final ByteBuffer | buffer |
int | bufferSizeAfterLimit |
int | currentLimit = Integer.MAX_VALUE |
boolean | enableAliasing |
final boolean | immutable |
int | lastTag |
long | limit |
long | pos |
long | startPos |
Additional Inherited Members | |
![]() | |
static int | decodeZigZag32 (final int n) |
static long | decodeZigZag64 (final long n) |
static CodedInputStream | newInstance (ByteBuffer buf) |
static CodedInputStream | newInstance (final byte[] buf) |
static CodedInputStream | newInstance (final byte[] buf, final int off, final int len) |
static CodedInputStream | newInstance (final InputStream input) |
static CodedInputStream | newInstance (final InputStream input, int bufferSize) |
static CodedInputStream | newInstance (final Iterable< ByteBuffer > input) |
static int | readRawVarint32 (final int firstByte, final InputStream input) throws IOException |
A CodedInputStream implementation that uses a backing direct ByteBuffer as the input. Requires the use of
to perform fast reads on the buffer.
Definition at line 1278 of file CodedInputStream.java.
|
inlineprivate |
Definition at line 1319 of file CodedInputStream.java.
|
inlineprivate |
Definition at line 2002 of file CodedInputStream.java.
|
inline |
Verifies that the last call to readTag() returned the given tag value. This is used to verify that a nested group ended with the correct end tag.
InvalidProtocolBufferException |
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1345 of file CodedInputStream.java.
|
inline |
Enables ByteString aliasing of the underlying buffer, trading off on buffer pinning for data copies. Only valid for buffer-backed streams.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1893 of file CodedInputStream.java.
|
inline |
Returns the number of bytes to be read before the current limit. If no limit is set, returns -1.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1926 of file CodedInputStream.java.
|
inline |
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1352 of file CodedInputStream.java.
|
inline |
The total bytes read up to the current position. Calling resetSizeCounter() resets this value to zero.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1940 of file CodedInputStream.java.
|
inline |
Returns true if the stream has reached the end of the input. This is the case if either the end of the underlying input source has been reached or if the stream has reached a limit created using pushLimit(int).
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1935 of file CodedInputStream.java.
|
inline |
Discards the current limit, returning to the previous limit.
oldLimit | The old limit, as returned by . |
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1920 of file CodedInputStream.java.
|
inline |
Sets
to (current position) +
. This is called when descending into a length-delimited embedded message.
Note that
does NOT affect how many bytes the
reads from an underlying
when refreshing its buffer. If you need to prevent reading past a certain point in the underlying
(e.g. because you expect it to contain more data after the end of the message which you need to handle differently) then you must place a wrapper around your
which limits the amount of data that can be read from it.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1903 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1493 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1639 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1644 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1613 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1458 of file CodedInputStream.java.
|
inline |
Read an enum field value from the stream. Caller is responsible for converting the numeric value to an actual enum.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1679 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1488 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1483 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1463 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1541 of file CodedInputStream.java.
|
inline |
Read an
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1478 of file CodedInputStream.java.
|
inline |
Read an
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1473 of file CodedInputStream.java.
|
inline |
Read an embedded message field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1580 of file CodedInputStream.java.
|
inline |
Read one byte from the input.
InvalidProtocolBufferException | The end of the stream or the current limit was reached. |
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1945 of file CodedInputStream.java.
|
inline |
Read a fixed size of bytes from the input.
InvalidProtocolBufferException | The end of the stream or the current limit was reached. |
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1953 of file CodedInputStream.java.
|
inline |
Read a 32-bit little-endian integer from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1859 of file CodedInputStream.java.
|
inline |
Read a 64-bit little-endian integer from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1874 of file CodedInputStream.java.
|
inline |
Read a raw Varint from the stream. If larger than 32 bits, discard the upper bits.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1706 of file CodedInputStream.java.
|
inline |
Read a raw Varint from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1774 of file CodedInputStream.java.
|
inline |
Read an
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1684 of file CodedInputStream.java.
|
inline |
Read an
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1689 of file CodedInputStream.java.
|
inline |
Read an
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1694 of file CodedInputStream.java.
|
inline |
Read an
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1699 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream. If the stream contains malformed UTF-8, replace the offending bytes with the standard UTF-8 replacement character.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1498 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream. If the stream contains malformed UTF-8, throw exception InvalidProtocolBufferException.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1522 of file CodedInputStream.java.
|
inline |
Attempt to read a field tag, returning zero if we have reached EOF. Protocol message parsers use this to read tags, since a protocol message may legally end wherever a tag occurs, and zero is not a valid tag number.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1329 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1674 of file CodedInputStream.java.
|
inline |
Read a
field value from the stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1468 of file CodedInputStream.java.
|
inline |
Reads a
field value from the stream and merges it into the given {}. deprecated 16.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1574 of file CodedInputStream.java.
|
inlineprivate |
Definition at line 1986 of file CodedInputStream.java.
|
inlineprivate |
Definition at line 1998 of file CodedInputStream.java.
|
inline |
Resets the current size counter to zero (see setSizeLimit(int)). Only valid for {}-backed streams.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1898 of file CodedInputStream.java.
|
inline |
Reads and discards a single field, given its tag value.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1357 of file CodedInputStream.java.
|
inline |
Reads a single field and writes it to output in wire format, given its tag value.
or
to skip to an output stream.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1384 of file CodedInputStream.java.
|
inline |
Reads and discards an entire message. This will read either until EOF or until an endgroup tag, whichever comes first.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1435 of file CodedInputStream.java.
|
inline |
Reads an entire message and writes it to output in wire format. This will read either until EOF or until an endgroup tag, whichever comes first.
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1445 of file CodedInputStream.java.
|
inline |
Reads and discards
bytes.
InvalidProtocolBufferException | The end of the stream or the current limit was reached. |
Reimplemented from com.google.protobuf.CodedInputStream.
Definition at line 1973 of file CodedInputStream.java.
|
inlineprivate |
Definition at line 1747 of file CodedInputStream.java.
|
inlineprivate |
Definition at line 1755 of file CodedInputStream.java.
|
inlineprivate |
Definition at line 1764 of file CodedInputStream.java.
|
inlineprivate |
Definition at line 2006 of file CodedInputStream.java.
|
private |
The unsafe address of the content of buffer.
Definition at line 1289 of file CodedInputStream.java.
|
private |
The direct buffer that is backing this stream.
Definition at line 1280 of file CodedInputStream.java.
|
private |
The amount of available data in the buffer beyond limit.
Definition at line 1301 of file CodedInputStream.java.
|
private |
The absolute position of the end of the current message.
Definition at line 1313 of file CodedInputStream.java.
|
private |
If
, indicates that calls to read ByteString or
may return slices of the underlying buffer, rather than copies.
Definition at line 1310 of file CodedInputStream.java.
|
private |
If
, indicates that the buffer is backing a ByteString and is therefore considered to be an immutable input source.
Definition at line 1286 of file CodedInputStream.java.
|
private |
The last tag that was read from this stream.
Definition at line 1304 of file CodedInputStream.java.
|
private |
The unsafe address of the current read limit of the buffer.
Definition at line 1292 of file CodedInputStream.java.
|
private |
The unsafe address of the current read position of the buffer.
Definition at line 1295 of file CodedInputStream.java.
|
private |
The unsafe address of the starting read position.
Definition at line 1298 of file CodedInputStream.java.