Buffers are the platform representation of a byte array which can be wrapped in a view
and manipulated by using the core helins.binf
namespaces. They represent a raw, fixed-size
chunk of memory.
On the JVM, a buffer is indeed a byte-array
.
In JS, it is either a js/ArrayBuffer
or its sibling js/SharedArrayBuffer
.
Buffers are the platform representation of a byte array which can be wrapped in a view and manipulated by using the core `helins.binf` namespaces. They represent a raw, fixed-size chunk of memory. On the JVM, a buffer is indeed a `byte-array`. In JS, it is either a `js/ArrayBuffer` or its sibling `js/SharedArrayBuffer`.
(alloc n-byte)
Allocates a new buffer having n-byte
bytes.
On the JVM, corresponds to a plain byte array.
In JS, corresponds to a JS ArrayBuffer
.
In order to do anything interesting with this library, it needs to be wrapped in a helins.binf/view
.
Allocates a new buffer having `n-byte` bytes. On the JVM, corresponds to a plain byte array. In JS, corresponds to a JS `ArrayBuffer`. In order to do anything interesting with this library, it needs to be wrapped in a [[helins.binf/view]].
(alloc-shared n-byte)
Akin to alloc
, allocates a JS SharedArrayBuffer
.
Throws if they are not supported by the JS environment.
Akin to [[alloc]], allocates a JS `SharedArrayBuffer`. Throws if they are not supported by the JS environment.
True if the JS environment supports using alloc-shared
.
True if the JS environment supports using [[alloc-shared]].
(copy src-buffer)
(copy dest-buffer src-buffer)
(copy dest-buffer dest-offset src-buffer)
(copy dest-buffer dest-offset src-buffer src-offset)
(copy dest-buffer dest-offset src-buffer src-offset n-byte)
Copies a buffer to another buffer.
Copies a buffer to another buffer.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close