Module Tarray.Buffer
ArrayBuffer
objects (byte buffers).
type t
The type for
ArrayBuffer
objects. They hold the bytes of typed arrays.
val create : int -> t
create n
is a new buffer withn
bytes.
val byte_length : t -> int
byte_length b
is the byte length ofb
.
val slice : ?start:int -> ?stop:int -> t -> t
slice ~start ~stop b
is a new buffer holding the bytes ofb
in range [start
;stop-1
]. This is a copy.start
defaults to0
andstop
tobyte_length b
.If
start
orstop
are negative they are subtracted frombyte_length b
. This means that-1
denotes the last byte of the buffer.