Moai SDK
1.5 revision 1 (MoaiEdition)
|
Forces any remaining buffered data into the stream.
function flush ( MOAIStream self )
self | ( MOAIStream ) |
Returns the current cursor position in the stream.
function getCursor ( MOAIStream self )
self | ( MOAIStream ) |
Returns the length of the stream.
function getLength ( MOAIStream self )
self | ( MOAIStream ) |
Reads bytes from the stream.
function read ( MOAIStream self [, number byteCount ] )
self | ( MOAIStream ) |
byteCount | ( number ) Optional. Number of bytes to read. Default value is the length of the stream. |
Reads a signed 16-bit value from the stream.
function read16 ( MOAIStream self )
self | ( MOAIStream ) |
Reads a signed 32-bit value from the stream.
function read32 ( MOAIStream self )
self | ( MOAIStream ) |
Reads a signed 8-bit value from the stream.
function read8 ( MOAIStream self )
self | ( MOAIStream ) |
Reads a 64-bit floating point value from the stream.
function readDouble ( MOAIStream self )
self | ( MOAIStream ) |
Reads a 32-bit floating point value from the stream.
function readFloat ( MOAIStream self )
self | ( MOAIStream ) |
Reads a series of values from the stream given a format string. Valid tokens for the format string are: u8 u16 u32 f d s8 s16 s32. Tokens may be optionally separated by spaces of commas.
function readFormat ( MOAIStream self, string format )
self | ( MOAIStream ) |
format | ( string ) |
Reads an unsigned 16-bit value from the stream.
function readU16 ( MOAIStream self )
self | ( MOAIStream ) |
Reads an unsigned 32-bit value from the stream.
function readU32 ( MOAIStream self )
self | ( MOAIStream ) |
Reads an unsigned 8-bit value from the stream.
function readU8 ( MOAIStream self )
self | ( MOAIStream ) |
Repositions the cursor in the stream.
function seek ( MOAIStream self, number offset [, number mode ] )
self | ( MOAIStream ) |
offset | ( number ) Value from the stream. |
mode | ( number ) Optional. One of MOAIStream.SEEK_CUR, MOAIStream.SEEK_END, MOAIStream.SEEK_SET. Default value is MOAIStream.SEEK_SET. |
Write binary data to the stream.
function write ( MOAIStream self, string bytes [, number size ] )
self | ( MOAIStream ) |
bytes | ( string ) Binary data to write. |
size | ( number ) Optional. Number of bytes to write. Default value is the size of the string. |
Writes a signed 16-bit value to the stream.
function write16 ( MOAIStream self, number value )
self | ( MOAIStream ) |
value | ( number ) Value to write. |
Writes a signed 32-bit value to the stream.
function write32 ( MOAIStream self, number value )
self | ( MOAIStream ) |
value | ( number ) Value to write. |
Writes a signed 8-bit value to the stream.
function write8 ( MOAIStream self, number value )
self | ( MOAIStream ) |
value | ( number ) Value to write. |
Writes a 64-bit floating point value to the stream.
function writeDouble ( MOAIStream self, number value )
self | ( MOAIStream ) |
value | ( number ) Value to write. |
Writes a 32-bit floating point value to the stream.
function writeFloat ( MOAIStream self, number value )
self | ( MOAIStream ) |
value | ( number ) Value to write. |
Writes a series of values to the stream given a format string. See 'readFormat' for a list of valid format tokens.
function writeFormat ( MOAIStream self, string format, ... )
self | ( MOAIStream ) |
format | ( string ) |
( | ... ) values Values to be written to the stream. |
Reads bytes from the given stream into the calling stream.
function writeStream ( MOAIStream self, MOAIStream stream [, number size ] )
self | ( MOAIStream ) |
stream | ( MOAIStream ) Value to write. |
size | ( number ) Optional. Number of bytes to read/write. Default value is the length of the input stream. |
Writes an unsigned 16-bit value to the stream.
function writeU16 ( MOAIStream self, number value )
self | ( MOAIStream ) |
value | ( number ) Value to write. |
Writes an unsigned 32-bit value to the stream.
function writeU32 ( MOAIStream self, number value )
self | ( MOAIStream ) |
value | ( number ) Value to write. |
Writes an unsigned 8-bit value to the stream.
function writeU8 ( MOAIStream self, number value )
self | ( MOAIStream ) |
value | ( number ) Value to write. |