-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathSocketStream.h
34 lines (30 loc) · 961 Bytes
/
SocketStream.h
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
32
33
34
#ifndef _SOCKETSTREAM_H_
#define _SOCKETSTREAM_H_
#include "InputStream.h"
#include "OutputStream.h"
class CSocketStream : public IInputStream, public IOutputStream
{
public:
CSocketStream();
virtual ~CSocketStream();
unsigned char *GetInput(void);
void SetInputSize(unsigned int nSize);
unsigned char *GetOutput(void);
unsigned int GetOutputSize(void);
unsigned int GetBufferSize(void);
unsigned int Read(void *pData, unsigned int nSize);
unsigned int Read(unsigned long *pnValue);
unsigned int Read8(unsigned __int64 *pnValue);
unsigned int Skip(unsigned int nSize);
unsigned int GetSize(void);
void Write(void *pData, unsigned int nSize);
void Write(unsigned long nValue);
void Write8(unsigned __int64 nValue);
void Seek(int nOffset, int nFrom);
int GetPosition(void);
void Reset(void);
private:
unsigned char *m_pInBuffer, *m_pOutBuffer;
unsigned int m_nInBufferIndex, m_nInBufferSize, m_nOutBufferIndex, m_nOutBufferSize;
};
#endif