AuroraRuntime/Source/Compression/BlockDecompressor.hpp
2021-09-13 22:13:41 +01:00

36 lines
1.1 KiB
C++

/***
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<Aurora::IO::IStreamReader> &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:
Aurora::Memory::ByteBuffer _outbuffer;
};
}