AuroraRuntime/Source/Compression/BlockDecompressor.hpp

36 lines
1.1 KiB
C++
Raw Normal View History

2021-06-27 21:25:29 +00:00
/***
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:
2021-09-06 10:58:08 +00:00
BaseStream(int bufferSize = 4096 * 4) : _outbuffer(bufferSize, true) {}
virtual ~BaseStream() {}
2021-06-27 21:25:29 +00:00
virtual bool Init(const AuSPtr<IO::IStreamReader> &reader) = 0;
2021-09-06 10:58:08 +00:00
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);
2021-06-27 21:25:29 +00:00
virtual void Flush() override {}
2021-06-27 21:25:29 +00:00
protected:
Memory::ByteBuffer _outbuffer;
2021-06-27 21:25:29 +00:00
};
}