diff --git a/qkc/serialize/bytebuffer.go b/qkc/serialize/bytebuffer.go index 3356747882..40286bf9d6 100644 --- a/qkc/serialize/bytebuffer.go +++ b/qkc/serialize/bytebuffer.go @@ -120,3 +120,10 @@ func (bb *ByteBuffer) GetVarBytes(byteSizeOfSliceLen int) ([]byte, error) { func (bb *ByteBuffer) Remaining() int { return bb.size - bb.position } + +// ReadRemaining returns all unread bytes in the buffer. +// Used by types that need to consume the rest of the buffer (e.g. opaque +// placeholder types for forward-compatible deserialization). +func (bb *ByteBuffer) ReadRemaining() ([]byte, error) { + return bb.getBytes(bb.Remaining()) +}