summaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/BitStream.hh
blob: d01be32ebe93e82dcc74701274ff2aa852fc2876 (plain) (blame)
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
// Read bits from a bit stream.  See BitWriter for writing.

#ifndef __BITSTREAM_HH__
#define __BITSTREAM_HH__

#include <qpdf/DLL.hh>

class DLL_EXPORT BitStream
{
  public:
    BitStream(unsigned char const* p, int nbytes);
    void reset();
    unsigned long getBits(int nbits);
    void skipToNextByte();

  private:
    unsigned char const* start;
    int nbytes;

    unsigned char const* p;
    unsigned int bit_offset;
    unsigned int bits_available;
};

#endif // __BITSTREAM_HH__