webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
com.google.protobuf.nano.MessageNano Class Referenceabstract
Inheritance diagram for com.google.protobuf.nano.MessageNano:
com.google.protobuf.nano.ExtendableMessageNano< M extends ExtendableMessageNano< M >

Public Member Functions

int getCachedSize ()
 
int getSerializedSize ()
 
void writeTo (CodedOutputByteBufferNano output) throws IOException
 
abstract MessageNano mergeFrom (CodedInputByteBufferNano input) throws IOException
 
String toString ()
 
MessageNano clone () throws CloneNotSupportedException
 

Static Public Member Functions

static final byte [] toByteArray (MessageNano msg)
 
static final void toByteArray (MessageNano msg, byte[] data, int offset, int length)
 
static final< T extends MessageNano > T mergeFrom (T msg, final byte[] data) throws InvalidProtocolBufferNanoException
 
static final< T extends MessageNano > T mergeFrom (T msg, final byte[] data, final int off, final int len) throws InvalidProtocolBufferNanoException
 
static final boolean messageNanoEquals (MessageNano a, MessageNano b)
 

Protected Member Functions

int computeSerializedSize ()
 

Protected Attributes

volatile int cachedSize = -1
 

Detailed Description

Abstract interface implemented by Protocol Message objects.

Author
wink@.nosp@m.goog.nosp@m.le.co.nosp@m.m Wink Saville

Member Function Documentation

◆ clone()

MessageNano com.google.protobuf.nano.MessageNano.clone ( void  ) throws CloneNotSupportedException
inline

Provides support for cloning. This only works if you specify the generate_clone method.

◆ computeSerializedSize()

int com.google.protobuf.nano.MessageNano.computeSerializedSize ( )
inlineprotected

Computes the number of bytes required to encode this message. This does not update the cached size.

◆ getCachedSize()

int com.google.protobuf.nano.MessageNano.getCachedSize ( )
inline

Get the number of bytes required to encode this message. Returns the cached size or calls getSerializedSize which sets the cached size. This is used internally when serializing so the size is only computed once. If a member is modified then this could be stale call getSerializedSize if in doubt.

◆ getSerializedSize()

int com.google.protobuf.nano.MessageNano.getSerializedSize ( )
inline

Computes the number of bytes required to encode this message. The size is cached and the cached result can be retrieved using getCachedSize().

◆ mergeFrom() [1/3]

abstract MessageNano com.google.protobuf.nano.MessageNano.mergeFrom ( CodedInputByteBufferNano  input) throws IOException
abstract

Parse

as a message of this type and merge it with the message being built.

◆ mergeFrom() [2/3]

static final<T extends MessageNano> T com.google.protobuf.nano.MessageNano.mergeFrom ( T  msg,
final byte []  data 
) throws InvalidProtocolBufferNanoException
inlinestatic

Parse

as a message of this type and merge it with the message being built.

◆ mergeFrom() [3/3]

static final<T extends MessageNano> T com.google.protobuf.nano.MessageNano.mergeFrom ( T  msg,
final byte []  data,
final int  off,
final int  len 
) throws InvalidProtocolBufferNanoException
inlinestatic

Parse

as a message of this type and merge it with the message being built.

◆ messageNanoEquals()

static final boolean com.google.protobuf.nano.MessageNano.messageNanoEquals ( MessageNano  a,
MessageNano  b 
)
inlinestatic

Compares two

MessageNano

s and returns true if the message's are the same class and have serialized form equality (i.e. all of the field values are the same).

◆ toByteArray() [1/2]

static final byte [] com.google.protobuf.nano.MessageNano.toByteArray ( MessageNano  msg)
inlinestatic

Serialize to a byte array.

Returns
byte array with the serialized data.

◆ toByteArray() [2/2]

static final void com.google.protobuf.nano.MessageNano.toByteArray ( MessageNano  msg,
byte []  data,
int  offset,
int  length 
)
inlinestatic

Serialize to a byte array starting at offset through length. The method getSerializedSize must have been called prior to calling this method so the proper length is know. If an attempt to write more than length bytes OutOfSpaceException will be thrown and if length bytes are not written then IllegalStateException is thrown.

◆ toString()

String com.google.protobuf.nano.MessageNano.toString ( )
inline

Returns a string that is (mostly) compatible with ProtoBuffer's TextFormat. Note that groups (which are deprecated) are not serialized with the correct field name.

This is implemented using reflection, so it is not especially fast nor is it guaranteed to find all fields if you have method removal turned on for proguard.

◆ writeTo()

void com.google.protobuf.nano.MessageNano.writeTo ( CodedOutputByteBufferNano  output) throws IOException
inline

Serializes the message and writes it to

.

Parameters
outputthe output to receive the serialized form.
Exceptions
IOExceptionif an error occurred writing to .

Member Data Documentation

◆ cachedSize

volatile int com.google.protobuf.nano.MessageNano.cachedSize = -1
protected

The documentation for this class was generated from the following file: