diff options
Diffstat (limited to 'ByteBuffer.h')
-rw-r--r-- | ByteBuffer.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ByteBuffer.h b/ByteBuffer.h index b3e06cf..3836966 100644 --- a/ByteBuffer.h +++ b/ByteBuffer.h @@ -17,14 +17,8 @@ public: class ByteBuffer { public: - /** - * Wrapping constructor, the size will be equal to the capacity. - */ ByteBuffer(const std::shared_ptr<uint8_t> bytes, size_t capacity); - /** - * Wrapping constructor. - */ ByteBuffer(const std::shared_ptr<uint8_t> bytes, size_t capacity, size_t zero, size_t size); inline size_t getSize() const { @@ -40,6 +34,10 @@ public: return ptr - zero; } + inline size_t getBytesLeft() const { + return end - ptr; + } + inline void setCursor(size_t newCursor) { // assertCanAccessRelative(newCursor); ptr = (uint8_t *) &zero[newCursor]; |