package containers
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=92143ceb4785ae5f8a07f3ab4ab9f6f32d31ead0536e9be4fdb818dd3c677e58
sha512=5fa80189d0e177af2302b48e72b70299d51fc36ac2019e1cbf389ff6a7f4705b10089405b5a719b3e4845b0d1349a47a967f865dc2e4e3f0d5a0167ef6c31431
doc/containers/CCByte_buffer/index.html
Module CCByte_buffer
Source
Byte buffer.
A dynamic vector of bytes that doesn't hide its internal from you. Same use case as Buffer.t
but with more power.
type t = {
mutable bs : bytes;
(*The backing bytes buffer
*)mutable len : int;
(*Length of the "active" slice in
*)bs
. The actual content of the buffer isbs[0]..bs[len-1]
. What comes after is undefined garbage.
}
The byte buffer. The definition is public since 3.13.1 .
Access the underlying byte buffer. This buffer can change after operations that affect the capacity (e.g. add_char
).
ensure_free buf n
ensures that the free space at the end of the buffer is at least n
.
shrink_to buf n
reduces length buf
to at most n
. Does nothing if the length is already <= n.
Set the char at the given offset, unsafe (no bound check)
to_slice buf
returns a slice of the current content. The slice shares the same byte array as buf
(until buf
is resized).