stuff-from-scratch/src/core/streams/InputBitStream.cpp
2022-11-23 15:41:33 +00:00

35 lines
558 B
C++

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