Skip to content

JSArrayBufferToByteBuffer

extension JSArrayBufferToByteBuffer on JSArrayBuffer

Conversions from JSArrayBuffer to ByteBuffer.

Properties

toDart extension no setter

ByteBuffer get toDart

Converts this JSArrayBuffer to a ByteBuffer by either casting or wrapping it.

INFO

Depending on whether code is compiled to JavaScript or Wasm, this conversion will have different semantics.

When compiling to JavaScript, ByteBuffers are JSArrayBuffers and this operation will be a cast.

When compiling to Wasm, the JSArrayBuffer is wrapped with a ByteBuffer implementation and the wrapper is returned.

Modifications to this JSArrayBuffer will affect the returned ByteBuffer and vice versa.

Available on JSArrayBuffer, provided by the JSArrayBufferToByteBuffer extension

Implementation
dart
external ByteBuffer get toDart;