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
|
|
|
|
2021-10-24 10:19:47 +00:00
|
|
|
virtual bool Init(const AuSPtr<IO::IStreamReader> &reader) = 0;
|
2021-09-06 10:58:08 +00:00
|
|
|
|
2021-09-07 07:37:15 +00:00
|
|
|
virtual bool ReadByProcessedN(void * /*opt*/, AuUInt32 minimumInflated) override;
|
2021-09-06 14:21:39 +00:00
|
|
|
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;
|
2021-09-07 07:59:56 +00:00
|
|
|
|
|
|
|
/// @deprecated
|
|
|
|
virtual AuUInt32 GetInternalBufferSize();
|
2021-09-06 14:21:39 +00:00
|
|
|
|
|
|
|
bool Write(const void *a, AuUInt32 length);
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2021-09-13 21:13:41 +00:00
|
|
|
virtual void Flush() override {}
|
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
protected:
|
2021-10-24 10:19:47 +00:00
|
|
|
Memory::ByteBuffer _outbuffer;
|
2021-06-27 21:25:29 +00:00
|
|
|
};
|
|
|
|
}
|