BufferInscriber
Allows for a more manual approach to buffer serialization / deserialization. It requires some manual byte math, and buffer construction.
Functions
new
BufferInscriber.new(instance: buffer?--
The buffer to initialize the class with.
) → BufferInscriber--
Returns an instance of the BufferInscriber class.
Create an instance of the BufferInscriber class.
info
The BufferInscriber class is much more low-level than the Buffer class. Using this class requires significantly more effort, as it does not handle everything that the Buffer class normally handles.
IncrementPointer
BufferInscriber:IncrementPointer(amount: number--
How much to increment the pointer by.
) → BufferInscriberThis function is used to increment the pointer.
SetPointer
This function is used to set the pointer.
Write
BufferInscriber:Write(memorySize: number,--
The amount of memory (bytes) being written.
dataType: string,--
The data type being inscribed.
value: number--
The value being inscribed.
) → BufferInscriberThis function is utilized internally. It is used to write a specific data type into a buffer, and increment the pointer accordingly.
Read
BufferInscriber:Read(memorySize: number,--
The amount of memory being read.
dataType: string--
The data type being read.
) → anyThis function is utilized internally. It is used to read a specific data type from the buffer, and increment the pointer accordingly.
ReadType
BufferInscriber:ReadType(dataType: string,--
What DataType to read.
offset: number?--
A starting pointer. If none is supplied, it will use the current pointer.
) → anyThis function is used to read a specific data type from the buffer.
WriteType
BufferInscriber:WriteType(dataType: string,--
What DataType to write.
data: any--
The data to write into the buffer.
) → BufferInscriberThis function is used to write a specific data type into the buffer.
SetBuffer
This function imports an external buffer, and begins using it.
Destroy
BufferInscriber:Destroy() → nilThis function cleans up the BufferInscriber instance.