PHP Class evseevnn\Cassandra\Protocol\Response\DataStream

Show file Open project: evseevnn/php-cassandra-binary Class Usage Examples

Public Methods

Method Description
__construct ( string $binary )
readBigInt ( $isCollectionElement = false ) : int; Read unsigned big int;
readBoolean ( ) : boolean Read boolean.
readByType ( array $type, boolean $isCollectionElement = false ) : mixed
readBytes ( boolean $isCollectionElement = false ) : string Read bytes.
readChar ( ) : integer Read single character.
readDecimal ( boolean $isCollectionElement = false ) : string Read variable length decimal.
readDouble ( boolean $isCollectionElement = false ) : double Read double.
readFloat ( boolean $isCollectionElement = false ) : float Read float.
readInet ( boolean $isCollectionElement = false ) : string Read inet.
readInt ( boolean $isCollectionElement = false ) : integer Read unsigned int.
readList ( $valueType ) : array Read list.
readLongString ( ) : string Read long string.
readMap ( $keyType, $valueType ) : array Read map.
readShort ( ) : integer Read unsigned short.
readString ( ) : string Read string.
readTimestamp ( ) : integer Read timestamp.
readUuid ( boolean $isCollectionElement = false ) : string Read uuid.
readVarint ( boolean $isCollectionElement = false ) : string Read variable length integer.

Protected Methods

Method Description
read ( integer $length ) : string Read data from stream.

Private Methods

Method Description
bchexdec ( string $hex ) : string

Method Details

__construct() public method

public __construct ( string $binary )
$binary string

read() protected method

Read data from stream.
protected read ( integer $length ) : string
$length integer
return string

readBigInt() public method

Read unsigned big int;
public readBigInt ( $isCollectionElement = false ) : int;
return int;

readBoolean() public method

Read boolean.
public readBoolean ( ) : boolean
return boolean

readByType() public method

public readByType ( array $type, boolean $isCollectionElement = false ) : mixed
$type array
$isCollectionElement boolean for collection element used other alg. a temporary solution
return mixed

readBytes() public method

Read bytes.
public readBytes ( boolean $isCollectionElement = false ) : string
$isCollectionElement boolean
return string

readChar() public method

Read single character.
public readChar ( ) : integer
return integer

readDecimal() public method

Read variable length decimal.
public readDecimal ( boolean $isCollectionElement = false ) : string
$isCollectionElement boolean
return string

readDouble() public method

Read double.
public readDouble ( boolean $isCollectionElement = false ) : double
$isCollectionElement boolean
return double

readFloat() public method

Read float.
public readFloat ( boolean $isCollectionElement = false ) : float
$isCollectionElement boolean
return float

readInet() public method

Read inet.
public readInet ( boolean $isCollectionElement = false ) : string
$isCollectionElement boolean
return string

readInt() public method

Read unsigned int.
public readInt ( boolean $isCollectionElement = false ) : integer
$isCollectionElement boolean
return integer

readList() public method

Read list.
public readList ( $valueType ) : array
$valueType
return array

readLongString() public method

Read long string.
public readLongString ( ) : string
return string

readMap() public method

Read map.
public readMap ( $keyType, $valueType ) : array
$keyType
$valueType
return array

readShort() public method

Read unsigned short.
public readShort ( ) : integer
return integer

readString() public method

Read string.
public readString ( ) : string
return string

readTimestamp() public method

Cassandra is using the default java date representation, which is the milliseconds since epoch. Since we cannot use 64 bits integers without extra libraries, we are reading this as two 32 bits numbers and calculate the seconds since epoch.
public readTimestamp ( ) : integer
return integer

readUuid() public method

Read uuid.
public readUuid ( boolean $isCollectionElement = false ) : string
$isCollectionElement boolean
return string

readVarint() public method

Read variable length integer.
public readVarint ( boolean $isCollectionElement = false ) : string
$isCollectionElement boolean
return string