PHP Class Protobuf\Message

Show file Open project: protobuf-php/protobuf

Public Methods

Method Description
clear ( ) Reset all fields back to the initial values.
extensions ( ) : ExtensionFieldMap Obtain the map of extensions in this message.
fromStream ( Stream | resource | string $stream, Configuration $configuration = null ) : Message Creates message from the given stream.
merge ( Message $message ) Merge $context into the message being built.
readFrom ( Protobuf\ReadContext $context ) Serializes the message and returns a stream containing its bytes.
serializedSize ( ComputeSizeContext $context ) : integer Compute the number of bytes that would be needed to encode the message
toStream ( Configuration $configuration = null ) : Stream Serializes the message and returns a stream containing its bytes.
unknownFieldSet ( ) : UnknownFieldSet Obtain the list of unknown fields in this message.
writeTo ( WriteContext $context ) : Stream Encodes and writes the message

Method Details

clear() public method

Reset all fields back to the initial values.
public clear ( )

extensions() public method

Obtain the map of extensions in this message.
public extensions ( ) : ExtensionFieldMap
return Protobuf\Extension\ExtensionFieldMap

fromStream() public static method

Creates message from the given stream.
public static fromStream ( Stream | resource | string $stream, Configuration $configuration = null ) : Message
$stream Stream | resource | string
$configuration Configuration
return Message

merge() public method

Merge $context into the message being built.
public merge ( Message $message )
$message Message

readFrom() public method

Serializes the message and returns a stream containing its bytes.
public readFrom ( Protobuf\ReadContext $context )
$context Protobuf\ReadContext

serializedSize() public method

Compute the number of bytes that would be needed to encode the message
public serializedSize ( ComputeSizeContext $context ) : integer
$context ComputeSizeContext
return integer

toStream() public method

Serializes the message and returns a stream containing its bytes.
public toStream ( Configuration $configuration = null ) : Stream
$configuration Configuration
return Stream

unknownFieldSet() public method

Obtain the list of unknown fields in this message.
public unknownFieldSet ( ) : UnknownFieldSet
return UnknownFieldSet

writeTo() public method

Encodes and writes the message
public writeTo ( WriteContext $context ) : Stream
$context WriteContext
return Stream