1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
let set_int32 = Bytes.set_int32_be
let get_int32 = Bytes.get_int32_be
let get_int32_string s off = Bytes.get_int32_be (Bytes.unsafe_of_string s) off
let set_int8 = Bytes.set_int8
let get_int8 = Bytes.get_int8
let get_int8_string s off = Bytes.get_int8 (Bytes.unsafe_of_string s) off
let set_int16 = Bytes.set_int16_be
let get_int16 = Bytes.get_int16_be
let get_int16_string s off = Bytes.get_int16_be (Bytes.unsafe_of_string s) off
let set_int64 = Bytes.set_int64_be
let get_int64 = Bytes.get_int64_be
let get_int64_string s off = Bytes.get_int64_be (Bytes.unsafe_of_string s) off
let set_uint8 = Bytes.set_uint8
let get_uint8 = Bytes.get_uint8
let get_uint8_string s off = Bytes.get_uint8 (Bytes.unsafe_of_string s) off
let set_uint16 = Bytes.set_uint16_be
let get_uint16 = Bytes.get_uint16_be
let get_uint16_string s off = Bytes.get_uint16_be (Bytes.unsafe_of_string s) off
let get_double buff i = Int64.float_of_bits (Bytes.get_int64_be buff i)
let get_double_string buff i =
Int64.float_of_bits (Bytes.get_int64_be (Bytes.unsafe_of_string buff) i)
let set_double buff i v = Bytes.set_int64_be buff i (Int64.bits_of_float v)