Grpc.Buffert represents a buffer which is based on bytes but keeps track of the length of valid data inside it. The internal capacity is increased when needed.
val v : ?capacity:int -> unit -> tc ~capacity () creates a new buffer with internal capacity capacity.
val length : t -> intlength t returns the length of valid data in the buffer.
val capacity : t -> intcapacity t returns the total capacity of the buffer.
val to_bytes : t -> bytesto_bytes t converts the valid data in the buffer into bytes.
val to_string : t -> stringto_string t converts the valid data in the buffer into a string.
val copy_from_bigstringaf :
src_off:int ->
src:Bigstringaf.t ->
dst:t ->
length:int ->
unitcopy_from_bigstringaf ~src_off ~src ~dst ~length copies data from src into dst starting from src_off and ending at src_off + length to the end of the buffer.
sub ~start ~length t creates a new buffer from the current, containing the data in the range [start, start+length).
val get_u8 : pos:int -> t -> intget_u8 ~pos t returns the unsigned 8 bit integer at pos in t.
val get_u32_be : pos:int -> t -> intget_u32_be ~pos t returns the unsigned 32 bit big endian integer at pos in t.
val shift_left : by:int -> t -> unitshift_left ~by t shifts t left by by positions, discarding the data.