forked from mirrors/kolyah35-minecraft-pe-0.6.1
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
49
src/util/RakDataIO.h
Executable file
49
src/util/RakDataIO.h
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
#ifndef RAKDATAIO_H__
|
||||
#define RAKDATAIO_H__
|
||||
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include "DataIO.h"
|
||||
|
||||
// Uses BitStream as a growing buffer
|
||||
class RakDataOutput: public BytesDataOutput {
|
||||
public:
|
||||
//RakDataOutput() {}
|
||||
RakDataOutput(RakNet::BitStream& bitstream)
|
||||
: _bitStream(bitstream)
|
||||
{}
|
||||
|
||||
virtual void writeBytes(const void* data, int bytes) {
|
||||
_bitStream.WriteBits((const unsigned char*)data, bytes * 8);
|
||||
}
|
||||
|
||||
RakNet::BitStream& getBitStream() {
|
||||
return _bitStream;
|
||||
}
|
||||
|
||||
private:
|
||||
RakNet::BitStream& _bitStream;
|
||||
};
|
||||
|
||||
|
||||
class RakDataInput: public BytesDataInput {
|
||||
public:
|
||||
//RakDataOutput() {}
|
||||
RakDataInput(RakNet::BitStream& bitstream)
|
||||
: _bitStream(bitstream)
|
||||
{}
|
||||
|
||||
virtual void readBytes(void* data, int bytes) {
|
||||
_bitStream.ReadBits((unsigned char*) data, bytes * 8);
|
||||
}
|
||||
|
||||
RakNet::BitStream& getBitStream() {
|
||||
return _bitStream;
|
||||
}
|
||||
|
||||
private:
|
||||
RakNet::BitStream& _bitStream;
|
||||
};
|
||||
|
||||
#endif /*RAKDATAIO_H__*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue