Public Member Functions | Private Member Functions | Private Attributes | List of all members
com.google.protobuf.CodedInputStream.ArrayDecoder Class Reference
Inheritance diagram for com.google.protobuf.CodedInputStream.ArrayDecoder:
Inheritance graph
[legend]

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
 
- Public Member Functions inherited from com.google.protobuf.CodedInputStream
final int setRecursionLimit (final int limit)
 
final int setSizeLimit (final int limit)
 

Private Member Functions

 ArrayDecoder (final byte[] buffer, final int offset, final int len, boolean immutable)
 
void recomputeBufferSizeAfterLimit ()
 
void skipRawVarint () throws IOException
 
void skipRawVarintFastPath () throws IOException
 
void skipRawVarintSlowPath () throws IOException
 

Private Attributes

final byte[] buffer
 
int bufferSizeAfterLimit
 
int currentLimit = Integer.MAX_VALUE
 
boolean enableAliasing
 
final boolean immutable
 
int lastTag
 
int limit
 
int pos
 
int startPos
 

Additional Inherited Members

- Static Public Member Functions inherited from com.google.protobuf.CodedInputStream
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
 

Detailed Description

A CodedInputStream implementation that uses a backing array as the input.

Definition at line 593 of file CodedInputStream.java.

Constructor & Destructor Documentation

◆ ArrayDecoder()

com.google.protobuf.CodedInputStream.ArrayDecoder.ArrayDecoder ( final byte[]  buffer,
final int  offset,
final int  len,
boolean  immutable 
)
inlineprivate

Definition at line 606 of file CodedInputStream.java.

Member Function Documentation

◆ checkLastTagWas()

void com.google.protobuf.CodedInputStream.ArrayDecoder.checkLastTagWas ( final int  value) throws InvalidProtocolBufferException
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.

Exceptions
InvalidProtocolBufferException

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 631 of file CodedInputStream.java.

◆ enableAliasing()

void com.google.protobuf.CodedInputStream.ArrayDecoder.enableAliasing ( boolean  enabled)
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 1170 of file CodedInputStream.java.

◆ getBytesUntilLimit()

int com.google.protobuf.CodedInputStream.ArrayDecoder.getBytesUntilLimit ( )
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 1215 of file CodedInputStream.java.

◆ getLastTag()

int com.google.protobuf.CodedInputStream.ArrayDecoder.getLastTag ( )
inline

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 638 of file CodedInputStream.java.

◆ getTotalBytesRead()

int com.google.protobuf.CodedInputStream.ArrayDecoder.getTotalBytesRead ( )
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 1229 of file CodedInputStream.java.

◆ isAtEnd()

boolean com.google.protobuf.CodedInputStream.ArrayDecoder.isAtEnd ( ) throws IOException
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 1224 of file CodedInputStream.java.

◆ popLimit()

void com.google.protobuf.CodedInputStream.ArrayDecoder.popLimit ( final int  oldLimit)
inline

Discards the current limit, returning to the previous limit.

Parameters
oldLimitThe old limit, as returned by .

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 1209 of file CodedInputStream.java.

◆ pushLimit()

int com.google.protobuf.CodedInputStream.ArrayDecoder.pushLimit ( int  byteLimit) throws InvalidProtocolBufferException
inline

Sets

to (current position) +

byteLimit

. This is called when descending into a length-delimited embedded message.

Note that

does NOT affect how many bytes the

reads from an underlying

InputStream

when refreshing its buffer. If you need to prevent reading past a certain point in the underlying

InputStream

(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

InputStream

which limits the amount of data that can be read from it.

Returns
the old limit.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 1180 of file CodedInputStream.java.

◆ readBool()

boolean com.google.protobuf.CodedInputStream.ArrayDecoder.readBool ( ) throws IOException
inline

Read a

bool

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 779 of file CodedInputStream.java.

◆ readByteArray()

byte [] com.google.protobuf.CodedInputStream.ArrayDecoder.readByteArray ( ) throws IOException
inline

Read a

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 914 of file CodedInputStream.java.

◆ readByteBuffer()

ByteBuffer com.google.protobuf.CodedInputStream.ArrayDecoder.readByteBuffer ( ) throws IOException
inline

Read a

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 920 of file CodedInputStream.java.

◆ readBytes()

ByteString com.google.protobuf.CodedInputStream.ArrayDecoder.readBytes ( ) throws IOException
inline

Read a

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 894 of file CodedInputStream.java.

◆ readDouble()

double com.google.protobuf.CodedInputStream.ArrayDecoder.readDouble ( ) throws IOException
inline

Read a

double

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 744 of file CodedInputStream.java.

◆ readEnum()

int com.google.protobuf.CodedInputStream.ArrayDecoder.readEnum ( ) throws IOException
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 952 of file CodedInputStream.java.

◆ readFixed32()

int com.google.protobuf.CodedInputStream.ArrayDecoder.readFixed32 ( ) throws IOException
inline

Read a

fixed32

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 774 of file CodedInputStream.java.

◆ readFixed64()

long com.google.protobuf.CodedInputStream.ArrayDecoder.readFixed64 ( ) throws IOException
inline

Read a

fixed64

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 769 of file CodedInputStream.java.

◆ readFloat()

float com.google.protobuf.CodedInputStream.ArrayDecoder.readFloat ( ) throws IOException
inline

Read a

float

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 749 of file CodedInputStream.java.

◆ readGroup()

void com.google.protobuf.CodedInputStream.ArrayDecoder.readGroup ( final int  fieldNumber,
final MessageLite.Builder  builder,
final ExtensionRegistryLite  extensionRegistry 
) throws IOException
inline

Read a

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 822 of file CodedInputStream.java.

◆ readInt32()

int com.google.protobuf.CodedInputStream.ArrayDecoder.readInt32 ( ) throws IOException
inline

Read an

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 764 of file CodedInputStream.java.

◆ readInt64()

long com.google.protobuf.CodedInputStream.ArrayDecoder.readInt64 ( ) throws IOException
inline

Read an

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 759 of file CodedInputStream.java.

◆ readMessage()

void com.google.protobuf.CodedInputStream.ArrayDecoder.readMessage ( final MessageLite.Builder  builder,
final ExtensionRegistryLite  extensionRegistry 
) throws IOException
inline

Read an embedded message field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 861 of file CodedInputStream.java.

◆ readRawByte()

byte com.google.protobuf.CodedInputStream.ArrayDecoder.readRawByte ( ) throws IOException
inline

Read one byte from the input.

Exceptions
InvalidProtocolBufferExceptionThe end of the stream or the current limit was reached.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 1234 of file CodedInputStream.java.

◆ readRawBytes()

byte [] com.google.protobuf.CodedInputStream.ArrayDecoder.readRawBytes ( final int  size) throws IOException
inline

Read a fixed size of bytes from the input.

Exceptions
InvalidProtocolBufferExceptionThe end of the stream or the current limit was reached.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 1242 of file CodedInputStream.java.

◆ readRawLittleEndian32()

int com.google.protobuf.CodedInputStream.ArrayDecoder.readRawLittleEndian32 ( ) throws IOException
inline

Read a 32-bit little-endian integer from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 1134 of file CodedInputStream.java.

◆ readRawLittleEndian64()

long com.google.protobuf.CodedInputStream.ArrayDecoder.readRawLittleEndian64 ( ) throws IOException
inline

Read a 64-bit little-endian integer from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 1150 of file CodedInputStream.java.

◆ readRawVarint32()

int com.google.protobuf.CodedInputStream.ArrayDecoder.readRawVarint32 ( ) throws IOException
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 979 of file CodedInputStream.java.

◆ readRawVarint64()

long com.google.protobuf.CodedInputStream.ArrayDecoder.readRawVarint64 ( ) throws IOException
inline

Read a raw Varint from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 1048 of file CodedInputStream.java.

◆ readSFixed32()

int com.google.protobuf.CodedInputStream.ArrayDecoder.readSFixed32 ( ) throws IOException
inline

Read an

sfixed32

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 957 of file CodedInputStream.java.

◆ readSFixed64()

long com.google.protobuf.CodedInputStream.ArrayDecoder.readSFixed64 ( ) throws IOException
inline

Read an

sfixed64

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 962 of file CodedInputStream.java.

◆ readSInt32()

int com.google.protobuf.CodedInputStream.ArrayDecoder.readSInt32 ( ) throws IOException
inline

Read an

sint32

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 967 of file CodedInputStream.java.

◆ readSInt64()

long com.google.protobuf.CodedInputStream.ArrayDecoder.readSInt64 ( ) throws IOException
inline

Read an

sint64

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 972 of file CodedInputStream.java.

◆ readString()

String com.google.protobuf.CodedInputStream.ArrayDecoder.readString ( ) throws IOException
inline

Read a

string

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 784 of file CodedInputStream.java.

◆ readStringRequireUtf8()

String com.google.protobuf.CodedInputStream.ArrayDecoder.readStringRequireUtf8 ( ) throws IOException
inline

Read a

string

field value from the stream. If the stream contains malformed UTF-8, throw exception InvalidProtocolBufferException.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 804 of file CodedInputStream.java.

◆ readTag()

int com.google.protobuf.CodedInputStream.ArrayDecoder.readTag ( ) throws IOException
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 615 of file CodedInputStream.java.

◆ readUInt32()

int com.google.protobuf.CodedInputStream.ArrayDecoder.readUInt32 ( ) throws IOException
inline

Read a

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 947 of file CodedInputStream.java.

◆ readUInt64()

long com.google.protobuf.CodedInputStream.ArrayDecoder.readUInt64 ( ) throws IOException
inline

Read a

field value from the stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 754 of file CodedInputStream.java.

◆ readUnknownGroup()

void com.google.protobuf.CodedInputStream.ArrayDecoder.readUnknownGroup ( final int  fieldNumber,
final MessageLite.Builder  builder 
) throws IOException
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 855 of file CodedInputStream.java.

◆ recomputeBufferSizeAfterLimit()

void com.google.protobuf.CodedInputStream.ArrayDecoder.recomputeBufferSizeAfterLimit ( )
inlineprivate

Definition at line 1196 of file CodedInputStream.java.

◆ resetSizeCounter()

void com.google.protobuf.CodedInputStream.ArrayDecoder.resetSizeCounter ( )
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 1175 of file CodedInputStream.java.

◆ skipField() [1/2]

boolean com.google.protobuf.CodedInputStream.ArrayDecoder.skipField ( final int  tag) throws IOException
inline

Reads and discards a single field, given its tag value.

Returns
false
if the tag is an endgroup tag, in which case nothing is skipped. Otherwise, returns
true
.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 643 of file CodedInputStream.java.

◆ skipField() [2/2]

boolean com.google.protobuf.CodedInputStream.ArrayDecoder.skipField ( final int  tag,
final CodedOutputStream  output 
) throws IOException
inline

Reads a single field and writes it to output in wire format, given its tag value.

Returns
false
if the tag is an endgroup tag, in which case nothing is skipped. Otherwise, returns
true
.
Deprecated:
use

or

UnknownFieldSetLite

to skip to an output stream.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 670 of file CodedInputStream.java.

◆ skipMessage() [1/2]

void com.google.protobuf.CodedInputStream.ArrayDecoder.skipMessage ( ) throws IOException
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 721 of file CodedInputStream.java.

◆ skipMessage() [2/2]

void com.google.protobuf.CodedInputStream.ArrayDecoder.skipMessage ( CodedOutputStream  output) throws IOException
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 731 of file CodedInputStream.java.

◆ skipRawBytes()

void com.google.protobuf.CodedInputStream.ArrayDecoder.skipRawBytes ( final int  size) throws IOException
inline

Reads and discards

bytes.

Exceptions
InvalidProtocolBufferExceptionThe end of the stream or the current limit was reached.

Reimplemented from com.google.protobuf.CodedInputStream.

Definition at line 1260 of file CodedInputStream.java.

◆ skipRawVarint()

void com.google.protobuf.CodedInputStream.ArrayDecoder.skipRawVarint ( ) throws IOException
inlineprivate

Definition at line 1021 of file CodedInputStream.java.

◆ skipRawVarintFastPath()

void com.google.protobuf.CodedInputStream.ArrayDecoder.skipRawVarintFastPath ( ) throws IOException
inlineprivate

Definition at line 1029 of file CodedInputStream.java.

◆ skipRawVarintSlowPath()

void com.google.protobuf.CodedInputStream.ArrayDecoder.skipRawVarintSlowPath ( ) throws IOException
inlineprivate

Definition at line 1038 of file CodedInputStream.java.

Member Data Documentation

◆ buffer

final byte [] com.google.protobuf.CodedInputStream.ArrayDecoder.buffer
private

Definition at line 594 of file CodedInputStream.java.

◆ bufferSizeAfterLimit

int com.google.protobuf.CodedInputStream.ArrayDecoder.bufferSizeAfterLimit
private

Definition at line 597 of file CodedInputStream.java.

◆ currentLimit

int com.google.protobuf.CodedInputStream.ArrayDecoder.currentLimit = Integer.MAX_VALUE
private

The absolute position of the end of the current message.

Definition at line 604 of file CodedInputStream.java.

◆ enableAliasing

boolean com.google.protobuf.CodedInputStream.ArrayDecoder.enableAliasing
private

Definition at line 601 of file CodedInputStream.java.

◆ immutable

final boolean com.google.protobuf.CodedInputStream.ArrayDecoder.immutable
private

Definition at line 595 of file CodedInputStream.java.

◆ lastTag

int com.google.protobuf.CodedInputStream.ArrayDecoder.lastTag
private

Definition at line 600 of file CodedInputStream.java.

◆ limit

int com.google.protobuf.CodedInputStream.ArrayDecoder.limit
private

Definition at line 596 of file CodedInputStream.java.

◆ pos

int com.google.protobuf.CodedInputStream.ArrayDecoder.pos
private

Definition at line 598 of file CodedInputStream.java.

◆ startPos

int com.google.protobuf.CodedInputStream.ArrayDecoder.startPos
private

Definition at line 599 of file CodedInputStream.java.


The documentation for this class was generated from the following file:
google::protobuf::int64
int64_t int64
Definition: protobuf/src/google/protobuf/stubs/port.h:151
com.google.protobuf.CodedInputStream.ArrayDecoder.currentLimit
int currentLimit
Definition: CodedInputStream.java:604
google::protobuf::uint32
uint32_t uint32
Definition: protobuf/src/google/protobuf/stubs/port.h:155
google::protobuf::python::cmessage::UnknownFieldSet
static PyObject * UnknownFieldSet(CMessage *self)
Definition: python/google/protobuf/pyext/message.cc:2501
bytes
uint8 bytes[10]
Definition: coded_stream_unittest.cc:153
com.google.protobuf.CodedInputStream.CodedInputStream
CodedInputStream()
Definition: CodedInputStream.java:198
google::protobuf::int32
int32_t int32
Definition: protobuf/src/google/protobuf/stubs/port.h:150
google::protobuf::uint64
uint64_t uint64
Definition: protobuf/src/google/protobuf/stubs/port.h:156
com.google.protobuf.CodedInputStream.ArrayDecoder.pushLimit
int pushLimit(int byteLimit)
Definition: CodedInputStream.java:1180
size
GLsizeiptr size
Definition: glcorearb.h:2943
group
static uint32_t * group(tarjan *t, upb_refcounted *r)
Definition: ruby/ext/google/protobuf_c/upb.c:5943


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:06