AuroraRuntime/Source/Compression/BlockCompressor.cpp
2021-06-27 22:25:29 +01:00

44 lines
1022 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: BlockCompressor.cpp
Date: 2021-6-17
Author: Reece
***/
#include <RuntimeInternal.hpp>
#include "Compression.hpp"
#include "BlockCompressor.hpp"
#include "bzlib.h"
#include "zstd.h"
#include "zlib.h"
#include "lz4.h"
namespace Aurora::Compression
{
bool BaseStreamDeflate::Read(void * /*opt*/ buffer, AuUInt32 &len, bool ingestUntilError)
{
if (ingestUntilError)
{
while (this->_outbuffer.size() < len)
{
if (!Ingest(0, len))
{
return false;
}
}
}
return StreamRead(buffer, len, this->_outbuffer);
}
AUKN_SYM ICompressionStreamEx *CompressorNew(IO::IStreamReader *reader, const CompressionInfo &info)
{
return nullptr;
}
AUKN_SYM void CompressorRelease(ICompressionStreamEx * stream)
{
SafeDelete<BaseStreamDeflate *>(stream);
}
}