Skip to content
Advertisement

Resize ArrayBuffer

If I want to create an arraybuffer, I write: var buff = new ArrayBuffer(size)

But how is it possible to resize an existing buffer? I mean, adding some more bytes at the end of the buffer.

Advertisement

Answer

JavaScript

I’ve done it in C++ like this. Just made a bigger array and copy the contents over and then return the larger array and set it as the original.

Advertisement