PHP Class Protobuf\Binary\StreamWriter

Author: Iván Montes ([email protected])
Author: Fabio B. Silva ([email protected])
Show file Open project: protobuf-php/protobuf Class Usage Examples

Protected Properties

Property Type Description
$config Protobuf\Configuration
$isBigEndian boolean
$negativeEncoder Protobuf\Binary\Platform\NegativeEncoder

Public Methods

Method Description
__construct ( Configuration $config ) Constructor
writeBool ( Stream $stream, boolean $value ) Encode a bool.
writeByte ( Stream $stream, integer $value ) Store a single byte.
writeByteStream ( Stream $stream, Stream $value ) Encode a stream of bytes.
writeBytes ( Stream $stream, string $bytes, integer $length = null ) Store the given bytes in the stream.
writeDouble ( Stream $stream, float $value ) Encode a number as a 64bit double.
writeFixed32 ( Stream $stream, integer $value ) Encode an integer as a fixed of 32bits without sign.
writeFixed64 ( Stream $stream, integer $value ) Encode an integer as a fixed of 64bits without sign.
writeFloat ( Stream $stream, float $value ) Encode a number as a 32bit float.
writeSFixed32 ( Stream $stream, integer $value ) Encode an integer as a fixed of 32bits with sign.
writeSFixed64 ( Stream $stream, integer $value ) Encode an integer as a fixed of 64bits with sign.
writeStream ( Stream $stream, Stream $value, integer $length = null ) Write the given stream.
writeString ( Stream $stream, string $value ) Encode a string.
writeVarint ( Stream $stream, integer $value ) Store an integer encoded as varint.
writeZigzag ( Stream $stream, integer $value, integer $base = 32 ) Encodes an integer with zigzag.
writeZigzag32 ( Stream $stream, integer $value ) Encodes an integer with zigzag.
writeZigzag64 ( Stream $stream, integer $value ) Encodes an integer with zigzag.

Method Details

__construct() public method

Constructor
public __construct ( Configuration $config )
$config Protobuf\Configuration

writeBool() public method

Encode a bool.
public writeBool ( Stream $stream, boolean $value )
$stream Protobuf\Stream
$value boolean

writeByte() public method

Store a single byte.
public writeByte ( Stream $stream, integer $value )
$stream Protobuf\Stream
$value integer

writeByteStream() public method

Encode a stream of bytes.
public writeByteStream ( Stream $stream, Stream $value )
$stream Protobuf\Stream
$value Protobuf\Stream

writeBytes() public method

Store the given bytes in the stream.
public writeBytes ( Stream $stream, string $bytes, integer $length = null )
$stream Protobuf\Stream
$bytes string
$length integer

writeDouble() public method

Encode a number as a 64bit double.
public writeDouble ( Stream $stream, float $value )
$stream Protobuf\Stream
$value float

writeFixed32() public method

Encode an integer as a fixed of 32bits without sign.
public writeFixed32 ( Stream $stream, integer $value )
$stream Protobuf\Stream
$value integer

writeFixed64() public method

Encode an integer as a fixed of 64bits without sign.
public writeFixed64 ( Stream $stream, integer $value )
$stream Protobuf\Stream
$value integer

writeFloat() public method

Encode a number as a 32bit float.
public writeFloat ( Stream $stream, float $value )
$stream Protobuf\Stream
$value float

writeSFixed32() public method

Encode an integer as a fixed of 32bits with sign.
public writeSFixed32 ( Stream $stream, integer $value )
$stream Protobuf\Stream
$value integer

writeSFixed64() public method

Encode an integer as a fixed of 64bits with sign.
public writeSFixed64 ( Stream $stream, integer $value )
$stream Protobuf\Stream
$value integer

writeStream() public method

Write the given stream.
public writeStream ( Stream $stream, Stream $value, integer $length = null )
$stream Protobuf\Stream
$value Protobuf\Stream
$length integer

writeString() public method

Encode a string.
public writeString ( Stream $stream, string $value )
$stream Protobuf\Stream
$value string

writeVarint() public method

Store an integer encoded as varint.
public writeVarint ( Stream $stream, integer $value )
$stream Protobuf\Stream
$value integer

writeZigzag() public method

Encodes an integer with zigzag.
public writeZigzag ( Stream $stream, integer $value, integer $base = 32 )
$stream Protobuf\Stream
$value integer
$base integer

writeZigzag32() public method

Encodes an integer with zigzag.
public writeZigzag32 ( Stream $stream, integer $value )
$stream Protobuf\Stream
$value integer

writeZigzag64() public method

Encodes an integer with zigzag.
public writeZigzag64 ( Stream $stream, integer $value )
$stream Protobuf\Stream
$value integer

Property Details

$config protected property

protected Configuration,Protobuf $config
return Protobuf\Configuration

$isBigEndian protected property

protected bool $isBigEndian
return boolean

$negativeEncoder protected property

protected NegativeEncoder,Protobuf\Binary\Platform $negativeEncoder
return Protobuf\Binary\Platform\NegativeEncoder