package dune-release

  1. Overview
  2. Docs

Safe wrapping for some Bytes functions.

type t = Stdlib.Bytes.t

An alias for the type of byte sequences.

val make : int -> char -> (t, [> Bos_setup.R.msg ]) Bos_setup.result

make n c returns a new byte sequence of length n, filled with the byte c. Returns an error message if n < 0 or n > Sys.max_string_length.

val blit_string : string -> int -> t -> int -> int -> (unit, [> Bos_setup.R.msg ]) Bos_setup.result

blit src srcoff dst dstoff len copies len bytes from string src, starting at index srcoff, to byte sequence dst, starting at index dstoff. Returns an error message if srcoff and len do not designate a valid range of src, or if dstoff and len do not designate a valid range of dst.

OCaml

Innovation. Community. Security.