Writing values to the binary protocol using (mostly) OCaml.
Type of writer functions for the binary protocol. They take a buffer, a write position and a value, and return the next position after writing out the value.
bin_write_variant_int
writes out the exact little-endian bit
representation of the variant tag of the given value (= 32 bits).
bin_write_int_8bit
writes out the exact little-endian bit representation
of the given int
value using the lower 8 bits.
bin_write_int_16bit
writes out the exact little-endian bit representation
of the given int
value using the lower 16 bits.
bin_write_int_32bit
writes out the exact little-endian bit representation
of the given int
value using the lower 32 bits.
bin_write_int_64bit
writes out the exact little-endian bit representation
of the given int
value using all 64 bits. On 32bit platforms negative
numbers will be sign-extended in the 64bit representation.
bin_write_int64_bits
writes out the exact little-endian bit
representation of the given int64
value.
bin_write_network16_int
writes out an integer in 16bit network
byte order (= big-endian).
bin_write_network32_int
writes out an integer in 32bit network
byte order (= big-endian).
bin_write_network32_int32
writes out a 32bit integer in 32bit
network byte order (= big-endian).
bin_write_network64_int
writes out an integer in 64bit network
byte order (= big-endian).
bin_write_network64_int64
writes out a 64bit integer in 64bit
network byte order (= big-endian).
bin_write_array_no_length
writes out all values in the given array
without writing out its length.