class StringReader (View source)

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

Methods

__construct(string $filename)

No description

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

__construct(string $filename)

No description

Parameters

string $filename

Name of file to load

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

int readint(string $unpack, int $pos)

Reads a 32bit integer from the stream.

Parameters

string $unpack

Unpack string

int $pos Position

Return Value

int

Integer from the stream

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