Murl Engine Lua Addon API  Version 1.0 beta
Murl.BufferedData

The BufferedData object extends the Data object for appending data portions to pre-allocated memory.

The memory grows by doubling the memory size if needed. If the memory exceeds a size threshold, the memory grows in steps of the threshold. The size threshold is ignored if the size threshold is 0.


Table members

Inherited


Murl.Data

Functions


Murl.BufferedData.new()

The default constructor. Initializes the write position to 0 and the size threshold to 64 kilobytes.

Murl.BufferedData new()

Returns
Murl.BufferedData


Methods


ReleaseData()

Release the data. Free (delete) the memory and set the write position to 0.

ReleaseData()


SetSizeThreshold(sizeThreshold)

Set the memory growing size threshold. See AppendData().

SetSizeThreshold(Integer sizeThreshold)

Parameters
sizeThresholdThe memory growing size threshold in bytes.

GetSizeThreshold()

Get the memory growing size threshold. See AppendData().

Integer GetSizeThreshold()

Returns
Integer The memory growing size threshold in bytes.

SetWritePosition(bytePosition)

Set the write position.

SetWritePosition(Integer bytePosition)

Parameters
bytePositionThe write position in bytes.

GetWritePosition()

Get the write position.

Integer GetWritePosition()

Returns
Integer The write position in bytes.

Trim()

Trim the memory size to the write position.

Murl.Data Trim()

Returns
Murl.Data The data object itself.