LuaSTG-x Core API
lstg::Stream Class Reference
Inheritance diagram for lstg::Stream:
lstg::StreamFile lstg::StreamMemory

Public Member Functions

function fill (local dst, local length, local buffer)
 
function isResizable ()
 
function isWritable ()
 
function lock ()
 
function resize (local size)
 
function seek (local Origin, local Offset)
 
function size ()
 
function tell ()
 
function tryLock ()
 
function unlock ()
 

Member Function Documentation

◆ fill()

function fill ( local  dst,
local  length,
local  buffer 
)

Read from this and write to dst.

Parameters
dstlstg.Stream
lengthnumber
bufferlstg.Buffer
Returns
boolean

◆ isResizable()

function isResizable ( )

If the stream is resizable.

Returns
boolean

◆ isWritable()

function isWritable ( )

If the stream is writable.

Returns
boolean

◆ lock()

function lock ( )

Lock the stream. It is necessary when used in multi-thread.

note May cause block.

Returns
lstg.Stream

◆ resize()

function resize ( local  size)

Resize the stream.

Parameters
sizenumber
Returns
boolean

◆ seek()

function seek ( local  Origin,
local  Offset 
)

Set the position to read or write.

Parameters
Originnumber
Offsetnumber
Returns
boolean

◆ size()

function size ( )

Size of the stream.

Returns
number

◆ tell()

function tell ( )

Get the position to read or write.

Returns
number

◆ tryLock()

function tryLock ( )

Try to lock the stream, will return false when already locked.

This function will not block.

Returns
boolean

◆ unlock()

function unlock ( )

Unlock the stream.

Returns
lstg.Stream

The documentation for this class was generated from the following file: