24 lines
545 B
C++
24 lines
545 B
C++
#pragma once
|
|
|
|
#include "BitStream.h"
|
|
|
|
#include <ostream>
|
|
|
|
class OutputBitStream : public BitStream
|
|
{
|
|
public:
|
|
OutputBitStream(std::basic_ostream<char>* stream);
|
|
|
|
bool isFinished() const override;
|
|
|
|
std::vector<unsigned char> peekNextNBytes(unsigned n) const override;
|
|
|
|
std::optional<unsigned char> readNextByte() override;
|
|
|
|
void writeByte(unsigned char data, bool checkOverflow = true) override;
|
|
|
|
void writeBytes(const std::vector<unsigned char> data) override;
|
|
|
|
private:
|
|
std::basic_ostream<char>* mStream{nullptr};
|
|
};
|