/*** Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: BlockDecompressor.hpp Date: 2021-6-17 Author: Reece ***/ #pragma once namespace Aurora::Compression { class BaseStream : public ICompressionStream { public: BaseStream(int bufferSize = 4096 * 4) : _outbuffer(bufferSize, true) {} virtual ~BaseStream() {} virtual bool Init(const AuSPtr &reader) = 0; virtual bool ReadByProcessedN(void * /*opt*/, AuUInt32 minimumInflated) override; virtual bool ReadByProcessedN(void * /*opt*/, AuUInt32 minimumInflated, AuStreamReadWrittenPair_t &pair, bool ingestUntilEOS = true) override; virtual bool GoBackByProcessedN(AuUInt32 offset) override; virtual bool GoForwardByProcessedN(AuUInt32 offset) override; /// @deprecated virtual AuUInt32 GetInternalBufferSize(); bool Write(const void *a, AuUInt32 length); virtual void Flush() override {} protected: Memory::ByteBuffer _outbuffer; }; }