HolyLib Wiki

bitbuf

bitbuf

This library implements the engine bf_read and bf_write classes.
Supports: Linux32 | Linux64 | Windows32 | Windows64

Methods

bf_read bitbuf.CopyReadBuffer( bf_read buffer )
Copies the given buffer into a new one.
Useful if you want to save the data received by a client. The size is clamped internally between a minimum of 4 bytes and a maximum of 262144 bytes.
Creates a read buffer from the given data.
Useful if you want to read the userdata of the instancebaseline stringtable. The size is clamped internally between a minimum of 4 bytes and a maximum of 262144 bytes.
bitbuf.CreateStackReadBuffer( string data, function callback )
Creates a read buffer from the given data allocated on the stack making it faster.
Useful if you want to read the userdata of the instancebaseline stringtable.
The buffer will be stack allocated, do NOT call this function recursively and the buffer is only valid inside the callback function.
This is because you could cause a crash if you were to create too many stack allocated buffers!
The size is clamped internally between a minimum of 4 bytes and a maximum of 65536 bytes on Linux and to 8192 on Windows.
bitbuf.CreateStackWriteBuffer( string data, function callback )
Create a write buffer with the given size or with the given data allocated on the stack making it faster.
The buffer will be stack allocated, do NOT call this function recursively and the buffer is only valid inside the callback function.
This is because you could cause a crash if you were to create too many stack allocated buffers!
The size is clamped internally between a minimum of 4 bytes and a maximum of 65536 bytes on Linux and to 8192 on Windows.
Copies the given buffer into a new one.
Useful if you want to save the data received by a client. The size is clamped internally between a minimum of 4 bytes and a maximum of 262144 bytes.