Files
LibCommon/Source/Common/FileIO/CBitStreamInWrapper.h
T
Lioncache d6640792ec General: Cleanup
Mainly header hygeine and overload specifiers.

Also greatly reduces the amount of copying going on with math
primitives.
2025-12-17 15:41:49 -05:00

33 lines
651 B
C++

#ifndef CBITSTREAMINWRAPPER_H
#define CBITSTREAMINWRAPPER_H
#include <cstdint>
class IInputStream;
class CBitStreamInWrapper
{
public:
enum EChunkSize
{
k8Bit = 8, k16Bit = 16, k32Bit = 32
};
private:
IInputStream *mpSourceStream = nullptr;
EChunkSize mChunkSize{};
uint32_t mBitPool = 0;
uint32_t mBitsRemaining = 0;
public:
explicit CBitStreamInWrapper(IInputStream *pStream, EChunkSize ChunkSize = k32Bit);
void SetChunkSize(EChunkSize Size);
long ReadBits(uint32_t NumBits, bool ExtendSignBit = true);
bool ReadBit();
private:
void ReplenishPool();
};
#endif // CBITSTREAMINWRAPPER_H