BitStream.h
1 /************************************************************
2 * (C) Voxel Farm Inc. 2015
3 */
4 
5 #pragma once
6 
7 namespace VoxelFarm
8 {
10  class CBitStream
11  {
12  public:
13  CBitStream(void);
14  ~CBitStream(void);
15  public:
17  void allocate(int size);
19  unsigned int read(int bits);
21  void write(unsigned int data, int bits);
22  public:
24  unsigned char* buffer;
26  int pos;
28  bool ownsBuffer;
29  };
30 }
bool ownsBuffer
Indicates whether the buffer is owned by the stream object.
Definition: BitStream.h:28
Contains all classes and functions for the VoxelFarm engine.
unsigned int read(int bits)
Reads the specified number of bits.
int pos
Current read/write position in the stream.
Definition: BitStream.h:26
void write(unsigned int data, int bits)
Writes the specified number of bits.
unsigned char * buffer
A buffer that contains the data.
Definition: BitStream.h:24
A class for binary streams.
Definition: BitStream.h:10
void allocate(int size)
Reserves a specified number of bytes in the stream.