The class is used by DXNet and DXRenderer to pack data into a string, which can be sent to the server. This class also provides additional structure to packets sent which increases the ease of use when reading the data on the server-side. The byte buffer can write strings, integers and floating-point numbers currently, which also offer the same read operations, which means a packet could be structured similar to the way demonstrated below:
DXByteBuffer *Buffer = new DXByteBuffer(); Buffer->WriteInt(10); Buffer->WriteString(“test”); Buffer->WriteFloat(12.34);
int num = Buffer->ReadInt(); std::string str = Buffer->ReadString(); float fl = Buffer->ReadFloat();
Below is a list of implemented methods, accompanied with a brief description.