Convert to ArrayBufferView if data is ArrayBuffer