PHP Class Protobuf\Binary\StreamReader

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
$stream Protobuf\Stream

Public Methods

Method Description
__construct ( Configuration $config ) Constructor
readBool ( Stream $stream ) : boolean Decode a bool.
readByte ( Stream $stream ) : integer Reads a byte.
readByteStream ( Stream $stream ) : Stream Decode a stream of bytes.
readDouble ( Stream $stream ) : float Decode a 64bit double.
readFixed32 ( Stream $stream ) : integer Decode a fixed 32bit integer without sign.
readFixed64 ( Stream $stream ) : integer Decode a fixed 64bit integer without sign.
readFloat ( Stream $stream ) : float Decode a 32bit float.
readSFixed32 ( Stream $stream ) : integer Decode a fixed 32bit integer with sign.
readSFixed64 ( Stream $stream ) : integer Decode a fixed 64bit integer with sign.
readString ( Stream $stream ) : string Decode a string.
readUnknown ( Stream $stream, integer $wire ) : scalar Read unknown scalar value.
readVarint ( Stream $stream ) : integer Decode a varint.
readZigzag ( Stream $stream ) : integer Decodes a zigzag integer of the given bits.

Method Details

__construct() public method

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

readBool() public method

Decode a bool.
public readBool ( Stream $stream ) : boolean
$stream Protobuf\Stream
return boolean

readByte() public method

Reads a byte.
public readByte ( Stream $stream ) : integer
$stream Protobuf\Stream
return integer

readByteStream() public method

Decode a stream of bytes.
public readByteStream ( Stream $stream ) : Stream
$stream Protobuf\Stream
return Protobuf\Stream

readDouble() public method

Decode a 64bit double.
public readDouble ( Stream $stream ) : float
$stream Protobuf\Stream
return float

readFixed32() public method

Decode a fixed 32bit integer without sign.
public readFixed32 ( Stream $stream ) : integer
$stream Protobuf\Stream
return integer

readFixed64() public method

Decode a fixed 64bit integer without sign.
public readFixed64 ( Stream $stream ) : integer
$stream Protobuf\Stream
return integer

readFloat() public method

Decode a 32bit float.
public readFloat ( Stream $stream ) : float
$stream Protobuf\Stream
return float

readSFixed32() public method

Decode a fixed 32bit integer with sign.
public readSFixed32 ( Stream $stream ) : integer
$stream Protobuf\Stream
return integer

readSFixed64() public method

Decode a fixed 64bit integer with sign.
public readSFixed64 ( Stream $stream ) : integer
$stream Protobuf\Stream
return integer

readString() public method

Decode a string.
public readString ( Stream $stream ) : string
$stream Protobuf\Stream
return string

readUnknown() public method

Read unknown scalar value.
public readUnknown ( Stream $stream, integer $wire ) : scalar
$stream Protobuf\Stream
$wire integer
return scalar

readVarint() public method

Decode a varint.
public readVarint ( Stream $stream ) : integer
$stream Protobuf\Stream
return integer

readZigzag() public method

Decodes a zigzag integer of the given bits.
public readZigzag ( Stream $stream ) : integer
$stream Protobuf\Stream
return integer

Property Details

$config protected property

protected Configuration,Protobuf $config
return Protobuf\Configuration

$isBigEndian protected property

protected bool $isBigEndian
return boolean

$stream protected property

protected Stream,Protobuf $stream
return Protobuf\Stream