Cuberite
A lightweight, fast and extensible game server for Minecraft
CircularBufferCompressor.cpp
Go to the documentation of this file.
1 
2 #include "Globals.h"
4 #include "ByteBuffer.h"
5 
6 
7 
8 
9 
11 {
13 }
14 
15 
16 
17 
18 
20 {
22 }
23 
24 
25 
26 
27 
29 {
31 }
32 
33 
34 
35 
36 
38 {
39  Buffer.ReadSome(m_ContiguousIntermediate, Size);
40 }
41 
42 
43 
44 
45 
47 {
49 }
50 
51 
52 
53 
54 
56 {
57  return m_Extractor.ExtractZLib(m_ContiguousIntermediate, UncompressedSize);
58 }
59 
60 
61 
62 
63 
65 {
66  Buffer.ReadSome(m_ContiguousIntermediate, Size);
67 }
std::basic_string_view< std::byte > ContiguousByteBufferView
Definition: Globals.h:376
An object that can store incoming bytes and lets its clients read the bytes sequentially The bytes ar...
Definition: ByteBuffer.h:32
void ReadAll(ContiguousByteBuffer &a_Data)
Reads all available data into a_Data.
Definition: ByteBuffer.cpp:977
bool ReadSome(ContiguousByteBuffer &a_String, size_t a_Count)
Reads a_Count bytes into a_String; returns true if successful.
Definition: ByteBuffer.cpp:927
std::basic_string< std::byte > m_ContiguousIntermediate
Compression::Compressor m_Compressor
ContiguousByteBufferView GetView() const
void ReadFrom(cByteBuffer &Buffer)
void ReadFrom(cByteBuffer &Buffer, size_t Size)
Compression::Extractor m_Extractor
std::basic_string< std::byte > m_ContiguousIntermediate
ContiguousByteBufferView GetView() const
Compression::Result Extract(size_t UncompressedSize)
Contains the result of a compression or extraction operation.
Result CompressZLib(ContiguousByteBufferView Input)
Result ExtractZLib(ContiguousByteBufferView Input)