aboutsummaryrefslogtreecommitdiff
path: root/bitreader.h
blob: c4b92077b2ff1d2a0497ed7fe1f8eddf34a48c78 (plain)
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