Module
Data.ArrayBuffer.Cast
- Package
- purescript-arraybuffer
- Repository
- purescript-contrib/purescript-arraybuffer
DataView represents unaligned memory of unknown endianness.
ArrayView represents arrays of aligned elements of
local-machine endianness.
For the cases of Int8Array, Uint8Array, Uint8ClampedArray,
the elements
are single bytes, so they are always aligned and they have no
endianness. Therefore in those cases we can freely cast back and forth
to DataView.
#fromUint8Array Source
fromUint8Array :: Uint8Array -> Effect DataViewCast a UInt8Array to a DataView.
#fromUint8ClampedArray Source
fromUint8ClampedArray :: Uint8ClampedArray -> Effect DataViewCast a UInt8ClampedArray to a DataView.
#toUint8Array Source
toUint8Array :: DataView -> Effect Uint8ArrayCast a DataView to a Uint8Array.
#toUint8ClampedArray Source
toUint8ClampedArray :: DataView -> Effect Uint8ClampedArrayCast a DataView to a Uint8ClampedArray.