44 int read( QIODevice* ioDevice, qint64 size );
52 quint32 currentPosition();
54 void seek(quint32 nPos);
96 void pad(quint8 nNumBytes);
98 void skip(quint8 nNumBytes);
102 quint32 m_nCurrentPos;
104 bool ensureSpace(quint32 nSize);
quint32 readUInt32()
reads a four byte unsigned integer from the message, and moves the current position one by 4 bytes...
Definition: iobuffer.cpp:103
void writeUInt64(quint64 n)
writes 8 bytes at the current position and moves the position forwards by 8 bytes.
Definition: iobuffer.cpp:136
const QByteArray & getByteArray() const
get a copy of the message as a byte array:
Definition: iobuffer.cpp:82
void writeRawBytes(const QByteArray &ba)
Definition: iobuffer.cpp:183
quint16 readUInt16()
Read an unsigned short:
Definition: iobuffer.cpp:143
Provides a message buffer that can be used to read & write data across the network.
Definition: iobuffer.h:29
void writeUInt32(quint32 n)
writes four bytes at the current position and moves the position forwards by 4 bytes.
Definition: iobuffer.cpp:128
void pad(quint8 nNumBytes)
Pad a certain number of empty (0) bytes:
Definition: iobuffer.cpp:196
void skip(quint8 nNumBytes)
Skip a number of bytes - to be used with the pad() method above:
Definition: iobuffer.cpp:204
void writeByteArray(const QByteArray &ba)
writes data size, then data (without nulls) to message. Modifies position.
Definition: iobuffer.cpp:172
quint32 size() const
get message size:
Definition: iobuffer.cpp:51
quint8 readByte()
read a single byte. Modifies internal position:
Definition: iobuffer.cpp:87
void writeByte(quint8 n)
Write a single byte.
Definition: iobuffer.cpp:98
bool hasData()
returns true if there is still data in the buffer to read
Definition: iobuffer.cpp:62
void clear()
Clear the contents of the message:
Definition: iobuffer.cpp:45
IOBuffer()
construct a new, empty buffer:
Definition: iobuffer.cpp:27
void writeRawData(const void *data, int nLen)
Write raw byte data to buffer.
Definition: iobuffer.cpp:189
quint64 readUInt64()
reads a 8 byte unsigned long from the message, and moves the current position one by 4 bytes...
Definition: iobuffer.cpp:115
void writeUInt16(quint16 n)
Write an unsigned short:
Definition: iobuffer.cpp:155
QByteArray readByteArray(quint32 size)
reads a string of size length. Modifies position.
Definition: iobuffer.cpp:161