stuff-from-scratch/src/base/core/streams/InputBitStream.cpp
2023-12-18 10:16:31 +00:00

34 lines
535 B
C++

#include "InputBitStream.h"
InputBitStream::InputBitStream(std::basic_istream<unsigned char>* stream)
: BitStream(),
mStream(stream)
{
}
bool InputBitStream::isFinished() const
{
return mStream->good();
}
void InputBitStream::peekNextNBytes(std::size_t, VecBytes&) const
{
}
std::optional<Byte> InputBitStream::readNextByte()
{
if (mStream->good())
{
return static_cast<Byte>(mStream->get());
}
else
{
return std::nullopt;
}
}
void InputBitStream::writeByte(Byte, bool)
{
}