summaryrefslogtreecommitdiffstats
path: root/src/CircularBufferCompressor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CircularBufferCompressor.cpp')
-rw-r--r--src/CircularBufferCompressor.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/CircularBufferCompressor.cpp b/src/CircularBufferCompressor.cpp
new file mode 100644
index 000000000..823dd8862
--- /dev/null
+++ b/src/CircularBufferCompressor.cpp
@@ -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);
+}