\brief Like Finish, but override the final buffer size This is useful after writing data directly into the builder memory without calling the Append methods (basically, when using BufferBuilder mostly for memory allocation).
| 185 | /// without calling the Append methods (basically, when using BufferBuilder |
| 186 | /// mostly for memory allocation). |
| 187 | Result<std::shared_ptr<Buffer>> FinishWithLength(int64_t final_length, |
| 188 | bool shrink_to_fit = true) { |
| 189 | size_ = final_length; |
| 190 | return Finish(shrink_to_fit); |
| 191 | } |
| 192 | |
| 193 | void Reset() { |
| 194 | buffer_ = NULLPTR; |