Int8Array
t
type t = TypedArray.t<int>
The Int8Array
typed array represents an array of twos-complement 8-bit signed integers. See Int8Array on MDN
fromArray
let fromArray: array<int> => t
fromArray
creates a Int8Array
from an array of values. See TypedArray constructor on MDN
fromBuffer
let fromBuffer: (ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t
fromBuffer
creates a Int8Array
from an ArrayBuffer.t
. See TypedArray constructor on MDN
Note: This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
fromBufferToEnd
Deprecated
let fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t
fromBufferToEnd
creates a Int8Array
from an ArrayBuffer.t
, starting at a particular offset and continuing through to the end. See TypedArray constructor on MDN
Note: This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
fromBufferWithRange
Deprecated
let fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t
fromBufferWithRange
creates a Int8Array
from an ArrayBuffer.t
, starting at a particular offset and consuming length
bytes. See TypedArray constructor on MDN
Note: This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
fromLength
let fromLength: int => t
fromLength
creates a zero-initialized Int8Array
to hold the specified count of numbers; this is not a byte length. See TypedArray constructor on MDN
Note: This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
fromArrayLikeOrIterable
let fromArrayLikeOrIterable: ('a, ~map: ('b, int) => int=?) => t
fromArrayLikeOrIterable
creates a Int8Array
from an array-like or iterable object. See TypedArray.from on MDN
fromArrayLikeOrIterableWithMap
Deprecated
let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t
fromArrayLikeOrIterableWithMap
creates a Int8Array
from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See TypedArray.from on MDN
ignore
let ignore: t => unit
ignore(intArray)
ignores the provided intArray and returns unit.
This helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further.