Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef EBOOKBITSTREAM_H_INCLUDED
00011 #define EBOOKBITSTREAM_H_INCLUDED
00012
00013 #include "libebook_utils.h"
00014
00015
00016 namespace libebook
00017 {
00018
00019 class EBOOKBitStream
00020 {
00021 public:
00022 explicit EBOOKBitStream(librevenge::RVNGInputStream *stream);
00023
00024 uint32_t read(uint8_t numberOfBits, bool bigEndian = false);
00025
00026 bool isEnd() const;
00027 bool atLastByte() const;
00028
00029 private:
00030 void fill();
00031
00036 uint8_t readByte();
00037
00045 uint8_t readBits(uint8_t numberOfBits);
00046
00047 uint8_t readAvailableBits(uint8_t numberOfBits);
00048
00049 private:
00050 static const uint8_t s_masks[8];
00051
00052 private:
00053 librevenge::RVNGInputStream *const m_stream;
00054 uint8_t m_current;
00055 uint8_t m_available;
00056 };
00057
00058 }
00059
00060 #endif // EBOOKBITSTREAM_H_INCLUDED
00061
00062