Luv.BufferSourceData buffers.
Buffers with C storage.
These are OCaml bigstrings (char bigarrays). Roughly speaking, they correspond to C buffers referenced by pointers of type char*, but also know their own size.
In addition to being usable with the functions in this module, the type is compatible with at least the following libraries:
Bigarray from OCaml's standard libraryLwt_bytes from LwtLuv.Buffer.get buffer index retrieves the character in buffer at index.
Can also be written as buffer.{index}.
Like Luv.Buffer.get, but does not perform a bounds check.
Luv.Buffer.set buffer index value sets the character in buffer at index to value.
Can also be written as buffer.{index} <- value.
Like Luv.Buffer.set, but does not perform a bounds check.
Luv.Buffer.sub buffer ~offset ~length creates a view into buffer that starts at the given offset and has the given length.
No data is copied.
Copies data from source to destination.
The amount of data copied is the minimum of the two buffers' size.
To copy part of a buffer, use Luv.Buffer.sub to create a view, and pass the view to Luv.Buffer.blit.
Copies data from a buffer to a bytes buffer.
Copies data from a bytes buffer to a buffer.
Copies data from a string to a buffer.
Many Luv functions, such as Luv.File.write, work with lists of buffers (i.e., they do scatter-gather I/O). These are helpers for working with buffer lists.
drop buffers count drops the first count bytes from buffers.
For example, if buffers contains two buffers of size 16, drop buffers 18 will evaluate to a list that has lost the reference to the first buffer, and contains only a view into the second buffer of size 14.