From 7a73fd467cfadfe3b3a5cf43d3eea9392f4c7f34 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 8 Nov 2022 22:14:45 +0000 Subject: Protocol: Use correct calculation for delta movements (#5455) * Protocol: Use correct calculation for delta movements --- src/ByteBuffer.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ByteBuffer.h') diff --git a/src/ByteBuffer.h b/src/ByteBuffer.h index 1d108fca2..664887132 100644 --- a/src/ByteBuffer.h +++ b/src/ByteBuffer.h @@ -31,6 +31,7 @@ their own synchronization. class cByteBuffer { public: + cByteBuffer(size_t a_BufferSize); ~cByteBuffer(); @@ -47,7 +48,13 @@ public: size_t GetReadableSpace(void) const; /** Returns the current data start index. For debugging purposes. */ - size_t GetDataStart(void) const { return m_DataStart; } + size_t GetDataStart(void) const { return m_DataStart; } + + /** Returns if the given value can fit in a protocol big-endian 8 bit integer. */ + static bool CanBEInt8Represent(int a_Value); + + /** Returns if the given value can fit in a protocol big-endian 16 bit integer. */ + static bool CanBEInt16Represent(int a_Value); /** Returns true if the specified amount of bytes are available for reading */ bool CanReadBytes(size_t a_Count) const; -- cgit v1.2.3