class StringReader

Simple wrapper around string buffer for random access and values parsing.

Methods

__construct(string $filename)

Constructor.

string
read(int $pos, int $bytes)

Read number of bytes from given offset.

int
readint(string $unpack, int $pos)

Reads a 32bit integer from the stream.

array
readintarray(string $unpack, int $pos, int $count)

Reads an array of integers from the stream.

Details

at line 39
__construct(string $filename)

Constructor.

Parameters

string $filename Name of file to load

at line 53
string read(int $pos, int $bytes)

Read number of bytes from given offset.

Parameters

int $pos Offset
int $bytes Number of bytes to read

Return Value

string

at line 70
int readint(string $unpack, int $pos)

Reads a 32bit integer from the stream.

Parameters

string $unpack Unpack string
int $pos Position

Return Value

int Ingerer from the stream

at line 93
array readintarray(string $unpack, int $pos, int $count)

Reads an array of integers from the stream.

Parameters

string $unpack Unpack string
int $pos Position
int $count How many elements should be read

Return Value

array Array of Integers