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
#ifndef BITREADER_H #define BITREADER_H #include <QtCore/QIODevice> class BitReader { public: BitReader(QIODevice * device); ~BitReader(); quint64 readBits(int n); quint64 peekBits(int n); void skipUntilNextByte(); bool atEnd(); private: QIODevice *child; quint64 buf; int avail; }; #endif // BITREADER_H