Buffer

reserve() [Buffer class]

Adds reserved bytes to the buffer. The size must be larger than the current capacity.

// PROTOTYPE
bool reserve(size_t size) 

This can only be used to reserve additional space. To make the allocated buffer smaller, use trimToSize().

It is possible to reserve additional bytes at the end of the buffer that are larger than the data size. This allows for more efficient appending to the buffer when you know the eventual size, and eliminates multiple reallocations.

Normally you will use resize() to change the number of bytes used; this call is only for affecting the underlying memory used.