zlib -> libdeflate (#5085)
+ Use libdeflate + Use std::byte * Fix passing temporary to string_view + Emulate make_unique_for_overwrite
This commit is contained in:
67
src/CircularBufferCompressor.cpp
Normal file
67
src/CircularBufferCompressor.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
#include "Globals.h"
|
||||
#include "CircularBufferCompressor.h"
|
||||
#include "ByteBuffer.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ContiguousByteBufferView CircularBufferCompressor::GetView() const
|
||||
{
|
||||
return m_ContiguousIntermediate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Compression::Result CircularBufferCompressor::Compress()
|
||||
{
|
||||
return m_Compressor.CompressZLib(m_ContiguousIntermediate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void CircularBufferCompressor::ReadFrom(cByteBuffer & Buffer)
|
||||
{
|
||||
Buffer.ReadAll(m_ContiguousIntermediate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void CircularBufferCompressor::ReadFrom(cByteBuffer & Buffer, size_t Size)
|
||||
{
|
||||
Buffer.ReadSome(m_ContiguousIntermediate, Size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ContiguousByteBufferView CircularBufferExtractor::GetView() const
|
||||
{
|
||||
return m_ContiguousIntermediate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Compression::Result CircularBufferExtractor::Extract(size_t UncompressedSize)
|
||||
{
|
||||
return m_Extractor.ExtractZLib(m_ContiguousIntermediate, UncompressedSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void CircularBufferExtractor::ReadFrom(cByteBuffer & Buffer, size_t Size)
|
||||
{
|
||||
Buffer.ReadSome(m_ContiguousIntermediate, Size);
|
||||
}
|
||||
Reference in New Issue
Block a user