Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Shuttle.BytebufferSourceExtensible buffers using bigstrings.
create ?max_buffer_size size returns a new empty bytebuffer. The bytebuffer will be resized automatically, up-to max_buffer_size, if attempting to add more than size characters to the bytebuffer. max_buffer_size defaults to Int.max_value.
max_buffer_size is the maximum size that the underlying buffer can grow upto.
drop n removes n bytes from the beginning of the bytebuffer. This is usually called after a user processes some data from the buffer using a view into the internal bigstring via unsafe_peek.
Raises invalid_arg if n is greater than the buffer's length.
read buf fd reads bytes from the file descriptor fd and appends them to the end of the bytebuffer. Returns the number of bytes actually read.
Raises Bigstring_unix.IOError in the case of input errors, or on EOF.
write buf fd reads data from the beginning of the buffer and writes them to the file descriptor fd.
Returns the number of bytes actually written.
Raises Core_unix.Unix_error in case of i/o errors.
val read_assume_fd_is_nonblocking :
t ->
Core_unix.File_descr.t ->
Core_unix.Syscall_result.Int.tread_assume_fd_is_nonblocking buf fd is similar to read but it performs the read without yielding to other OCaml-threads. This function should only be called for non-blocking file-descriptors.
Returns the number of bytes actually read.
Raises Invalid_argument if the designated range is out of bounds.
write_assume_fd_is_nonblocking buf fd is similar to write buf it performs the write without yielding to other OCaml-threads. This function should only be called for non-blocking file-descriptors.
Returns the number of bytes actually written.
Raises Core_unix.Unix_error in case of i/o errors.
add_string appends the string at the end of the bytebuffer.
add_bytes appends the bytes at the end of the bytebuffer.
add_bigstring appends the bigstring at the end of the bytebuffer.
add_bytebuffer appends the contents of the buffer at the end of the bytebuffer.
to_string returns a copy of the current contents of the bytebuffer.