HolyLib Wiki

bf_write

bf_write

Metatable function Description
__tostring Returns a formated string of the bf_write -> bf_write [size in bits]
__index Used to find the functions on the metatable and access saved variables
__newindex Used to allow one to save variables on the object
__gc Internally deletes the bf_write turning it invalid

Methods

string bf_write:GetData( )
Returns the written data.
string bf_write:GetDebugName( )
Returns the debug name.
number bf_write:GetMaxNumBits( )
Returns the maximum number of bits that can be written.
number bf_write:GetNumBitsLeft( )
Returns the number of bits left.
Returns the number of bits written.
number bf_write:GetNumBytesLeft( )
Returns the number of bytes that are unwritten.
Returns the number of bytes written.
table bf_write:GetTable( )
Returns the lua table used by newindex and index
boolean bf_write:IsOverflowed( )
Returns true if the buffer is overflowed.
boolean bf_write:IsValid( )
Returns true if the buffer is valid.
bf_write:Reset()
Resets the buffer.
bf_write:SeekToBit( number bit )
Seeks to the given bit.
bf_write:SetDebugName( string name )
Sets the debug name.
You should keep a reference to the string as else this might be corrupted.
So store it somewhere, where the garbage collector won't delete it.
This is because internally, it sets the pointer of the debug name to the lua string, instead of copying over the actual string.
bf_write:WriteBitAngle( number value, number bits )
bf_write:WriteBitAngles( Angle value )
Writes a Angle
bf_write:WriteBitCoord( number value )
bf_write:WriteBitCoordMP( number value, boolean integral = false, boolean lowPrecision = false )
bf_write:WriteBitFloat( number value )
bf_write:WriteBitLong( number value )
bf_write:WriteBitNormal( number value )
boolean bf_write:WriteBits( string data, number bits )
Writes the given number of bits from the data into this buffer.
boolean bf_write:WriteBitsFromBuffer( bf_read buffer, number bits )
Writes the given number of bits from the given buffer into this buffer. The current position for the given buffer will change as we internally read from it!
bf_write:WriteBitVec3Coord( Vector value )
Writes a Vector
bf_write:WriteBitVec3Normal( Vector value )
Writes a normalized Vector
bf_write:WriteByte( number value )
Writes a byte.
bf_write:WriteBytes( string data )
Writes the given bytes.
bf_write:WriteChar( number value )
Writes a char.
bf_write:WriteFloat( number value )
Writes a float.
bf_write:WriteLong( number value )
Writes a long.
bf_write:WriteLongLong( number value )
Writes a long long. That's quite long xd
bf_write:WriteOneBit( boolean value = false )
Writes one bit.
bf_write:WriteOneBitAt( number bit, boolean value = false )
Sets the given bit to the given value.
bf_write:WriteShort( number value )
Writes a short.
bf_write:WriteSignedVarInt32( number value )
bf_write:WriteSignedVarInt64( number value )
bf_write:WriteString( string value )
Writes a null terminated string
bf_write:WriteUBitLong( number value, number bits, boolean signed = false )
bf_write:WriteUBitVar( number value )
bf_write:WriteVarInt32( number value )
bf_write:WriteVarInt64( number value )
bf_write:WriteWord( number value )
Writes a word.