2008-04-29 12:55:25 +00:00
|
|
|
// Read bits from a bit stream. See BitWriter for writing.
|
|
|
|
|
|
|
|
#ifndef __BITSTREAM_HH__
|
|
|
|
#define __BITSTREAM_HH__
|
|
|
|
|
2009-10-19 20:17:14 +00:00
|
|
|
#include <qpdf/DLL.h>
|
2009-09-26 15:19:12 +00:00
|
|
|
|
2009-10-21 00:27:24 +00:00
|
|
|
class BitStream
|
2008-04-29 12:55:25 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-10-21 01:45:13 +00:00
|
|
|
QPDF_DLL
|
2008-04-29 12:55:25 +00:00
|
|
|
BitStream(unsigned char const* p, int nbytes);
|
2009-10-21 01:45:13 +00:00
|
|
|
QPDF_DLL
|
2008-04-29 12:55:25 +00:00
|
|
|
void reset();
|
2009-10-21 01:45:13 +00:00
|
|
|
QPDF_DLL
|
2012-06-24 19:26:28 +00:00
|
|
|
unsigned long long getBits(int nbits);
|
2009-10-21 01:45:13 +00:00
|
|
|
QPDF_DLL
|
2008-04-29 12:55:25 +00:00
|
|
|
void skipToNextByte();
|
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned char const* start;
|
|
|
|
int nbytes;
|
|
|
|
|
|
|
|
unsigned char const* p;
|
|
|
|
unsigned int bit_offset;
|
|
|
|
unsigned int bits_available;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __BITSTREAM_HH__
|