This class contains two kinds of methods: methods that read specific protocol message
constructs and field types (e.g. readTag() and readInt32()) and methods that
read low-level values (e.g. readRawVarint32() and readRawBytes). If you are
reading encoded protocol messages, you should use the former methods, but if you are reading some
other format of your own design, use the latter.
| Modifier and Type | Class and Description |
|---|---|
| private static class | CodedInputStream.ArrayDecoder
A |
| private static class | CodedInputStream.IterableDirectByteBufferDecoder
Implementation of |
| private static class | CodedInputStream.StreamDecoder
Implementation of |
| private static class | CodedInputStream.UnsafeDirectNioDecoder
A |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int | |
| pack-priv int | recursionDepth
Visible for subclasses. |
| pack-priv int | |
| private boolean | |
| pack-priv int | sizeLimit
Visible for subclasses. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | checkLastTagWas(final int value)
Verifies that the last call to readTag() returned the given tag value. |
| public static int | Returns: A signed 32-bit integer.An unsigned 32-bit integer, stored in a signed int because Java has no explicit
unsigned support. n)Decode a ZigZag-encoded 32-bit value. |
| public static long | Returns: A signed 64-bit integer.An unsigned 64-bit integer, stored in a signed int because Java has no explicit
unsigned support. n)Decode a ZigZag-encoded 64-bit value. |
| pack-priv final void | |
| public abstract void | enableAliasing(boolean enabled)
Enables |
| public abstract int | |
| public abstract int | |
| public abstract int | |
| public abstract boolean | |
| public static CodedInputStream | |
| public static CodedInputStream | newInstance(final InputStream input, int bufferSize)
Create a new CodedInputStream wrapping the given InputStream, with a specified buffer size. |
| public static CodedInputStream | newInstance(final Iterable<ByteBuffer> input)
Create a new CodedInputStream wrapping the given |
| pack-priv static CodedInputStream | newInstance(final Iterable<ByteBuffer> bufs, final boolean bufferIsImmutable)
Create a new CodedInputStream wrapping the given |
| public static CodedInputStream | |
| public static CodedInputStream | newInstance(final byte[] buf, final int off, final int len)
Create a new CodedInputStream wrapping the given byte array slice. |
| pack-priv static CodedInputStream | newInstance(final byte[] buf, final int off, final int len, final boolean bufferIsImmutable)
Create a new CodedInputStream wrapping the given byte array slice. |
| public static CodedInputStream | |
| pack-priv static CodedInputStream | newInstance(ByteBuffer buf, boolean bufferIsImmutable)
Create a new CodedInputStream wrapping the given buffer. |
| public abstract void | popLimit(final int
The old limit, as returned by oldLimit)pushLimit.Discards the current limit, returning to the previous limit. |
| public abstract int | |
| public abstract boolean | |
| public abstract byte[] | |
| public abstract ByteBuffer | |
| public abstract ByteString | |
| public abstract double | |
| public abstract int | |
| public abstract int | |
| public abstract long | |
| public abstract float | |
| public abstract void | readGroup(final int fieldNumber, final MessageLite.
Read a |
| public abstract <T extends MessageLite> T | readGroup(final int fieldNumber, final Parser<T> parser, final ExtensionRegistryLite extensionRegistry)
Read a |
| public abstract int | |
| public abstract long | |
| public abstract void | readMessage(final MessageLite.
Read an embedded message field value from the stream. |
| public abstract <T extends MessageLite> T | readMessage(final Parser<T> parser, final ExtensionRegistryLite extensionRegistry)
Read an embedded message field value from the stream. |
| public abstract byte | |
| public abstract byte[] | |
| public abstract int | |
| public abstract long | |
| public abstract int | |
| public static int | readRawVarint32(final int firstByte, final InputStream input)
Like |
| pack-priv static int | readRawVarint32(final InputStream input)
Reads a varint from the input one byte at a time, so that it does not read any bytes after the end of the varint. |
| public abstract long | |
| pack-priv abstract long | |
| public abstract int | |
| public abstract long | |
| public abstract int | |
| public abstract long | |
| public abstract String | |
| public abstract String | |
| public abstract int | |
| public abstract int | |
| public abstract long | |
| public abstract void | readUnknownGroup(final int fieldNumber, final MessageLite.
Deprecated
UnknownFieldSet.Builder now implements MessageLite.Builder, so you can just call
Reads a readGroup.
group field value from the stream and merges it into the given UnknownFieldSet.
|
| public abstract void | |
| public final int | |
| public final int | |
| pack-priv final boolean | shouldDiscardUnknownFields()
Whether unknown fields in this input stream should be discarded during parsing into full runtime messages. |
| public abstract boolean | Returns: false if the tag is an endgroup tag, in which case nothing is skipped.
Otherwise, returns true.Reads and discards a single field, given its tag value. |
| public abstract boolean | Returns: false if the tag is an endgroup tag, in which case nothing is skipped.
Otherwise, returns true.
Deprecated
use
Reads a single field and writes it to output in wire format, given its tag value.
UnknownFieldSet or UnknownFieldSetLite to skip to an output
stream.
|
| public abstract void | |
| public abstract void | skipMessage(CodedOutputStream output)
Reads an entire message and writes it to output in wire format. |
| public abstract void | |
| pack-priv final void | unsetDiscardUnknownFields()
Reverts the unknown fields preservation behavior for Proto2 and Proto3 full runtime to their default. |