diff --git a/include/flatbuffers/flexbuffers.h b/include/flatbuffers/flexbuffers.h index fa22a8e39..2858e6485 100644 --- a/include/flatbuffers/flexbuffers.h +++ b/include/flatbuffers/flexbuffers.h @@ -802,6 +802,11 @@ class Builder FLATBUFFERS_FINAL_CLASS { return buf_; } + // Size of the buffer. Does not include unfinished values. + size_t GetSize() const { + return buf_.size(); + } + // Reset all state so we can re-use the buffer. void Clear() { buf_.clear();