-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWriteByteArray.h
More file actions
31 lines (31 loc) · 781 Bytes
/
WriteByteArray.h
File metadata and controls
31 lines (31 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _WRITEBYTEARRAY_H
#define _WRITEBYTEARRAY_H
class WriteByteArray
{
public:
WriteByteArray(int default_size=128);
WriteByteArray(const WriteByteArray&);
~WriteByteArray();
bool write(const char* lpBuffer, int Length);
bool isOverflow(int Length);
void resize();
void clearData();
const char* getBuffer(int& len) const;
bool writeBool(bool b);
bool writeInt8(char n);
//bool writeInt8(unsigned char n);
bool writeInt16(short n);
//bool writeInt16(unsigned short n);
bool writeInt32(int n);
//bool writeInt32(unsigned int n);
bool writeInt64(long long n);
//bool writeInt64(unsigned long long n);
bool writeFloat(float n);
bool writeDouble(double n);
bool writeUTF(const char* utf,int len);
public:
int m_size;
int m_curindex;
char* m_pBuffer;
};
#endif