summaryrefslogtreecommitdiffstats
path: root/src/ByteBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ByteBuffer.cpp')
-rw-r--r--src/ByteBuffer.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp
index 77e3f61fd..4a1e6f13a 100644
--- a/src/ByteBuffer.cpp
+++ b/src/ByteBuffer.cpp
@@ -117,6 +117,20 @@ cByteBuffer::cByteBuffer(size_t a_BufferSize) :
+cByteBuffer::cByteBuffer(const cByteBuffer & a_ByteBuffer)
+{
+ m_Buffer = new char[a_ByteBuffer.m_BufferSize];
+ m_BufferSize = a_ByteBuffer.m_BufferSize;
+ m_DataStart = a_ByteBuffer.m_DataStart;
+ m_WritePos = a_ByteBuffer.m_WritePos;
+ m_ReadPos = a_ByteBuffer.m_ReadPos;
+ memcpy(m_Buffer, a_ByteBuffer.m_Buffer, m_BufferSize);
+}
+
+
+
+
+
cByteBuffer::~cByteBuffer()
{
CheckValid();
@@ -986,3 +1000,24 @@ size_t cByteBuffer::GetVarIntSize(UInt32 a_Value)
+cByteBuffer * cByteBuffer::Create(size_t a_BufferSize)
+{
+ return new cByteBuffer(a_BufferSize);
+}
+
+
+
+
+
+void cByteBuffer::Destroy(cByteBuffer * a_ByteBuffer)
+{
+ if (a_ByteBuffer != nullptr)
+ {
+ delete a_ByteBuffer;
+ }
+}
+
+
+
+
+