transforming arrays and array buffers