moveWrittenDataToEnd
Special operation where we increase the backed buffer size to capacity and shift all already written data to the end of the buffer.
This function is mostly used when creating a Flatbuffer message, as data is written from the end of the buffer towards index 0.
Return
new capacity in bytes
Parameters
capacity
required in bytes