| Parameter | Description |
|---|---|
| elem | The element to add to the buffer. |
int The index of the added element, which is equal to the new length of the buffer minus one.
Adds an element to the end of the buffer, resizing as necessary.
The buffer is resized if it has no additional capacity.