\Mobi_Mtld_DA_Carrier_ByteReader

This class gets a chunk of binary data (bytes) then the methods are used to read data segments based on the data of data being read from the chunk, the read pointer will advance to the next bytes.

All numeric values must be read in little endian byte order. All numeric data is signed unless the method specifies otherwise - e.g. getIntUnsigned()

Summary

Methods
Properties
Constants
__construct()
skip()
getByte()
getBoolean()
getShort()
getInt()
getIntUnsigned()
getLong()
getFloat()
getDouble()
getBytes()
getStringAscii()
getStringUtf8()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$buff
$position
N/A

Properties

$buff

$buff : 

Data buffer

Type

$position

$position : 

Pointer position

Type

Methods

__construct()

__construct(  $data) 

Creates instance.

Parameters

$data

skip()

skip(  $lenShort) 

Skip bytes.

Parameters

$lenShort

getByte()

getByte() : string

Read one byte.

Returns

string —

Read data

getBoolean()

getBoolean() : boolean

Read 1byte as boolean.

Returns

boolean —

Read data

getShort()

getShort() : integer

Read 2bytes as short.

Returns

integer —

Read data

getInt()

getInt() : integer

Read 4bytes as integer.

Returns

integer —

Read data

getIntUnsigned()

getIntUnsigned() : integer

Read 4bytes as unsigned integer.

Returns

integer —

Read data

getLong()

getLong() : integer

Read

Returns

integer —

Read data

getFloat()

getFloat() : float

Read 4 bytes as float.

Returns

float —

Read data

getDouble()

getDouble() : double

Read 8bytes as double.

Returns

double —

Read data

getBytes()

getBytes(  $length) : integer

Read n bytes.

Parameters

$length

Returns

integer —

Read data

getStringAscii()

getStringAscii(  $length) : string

Read n bytes as string.

Parameters

$length

Returns

string —

Read data

getStringUtf8()

getStringUtf8(  $length) : string

Read n bytes as UTF8 string.

Parameters

$length

Returns

string —

Read data