-
Notifications
You must be signed in to change notification settings - Fork 0
/
bin.generated.go
260 lines (195 loc) · 6.87 KB
/
bin.generated.go
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
// This file has been generated from 'bin.yml', do not edit
package bin
import "encoding/binary"
// I8be wraps a byte array into a big endian encoded 8bit signed integer.
type I8be [1]byte
// Len returns the number of bytes required to store the value.
func (b *I8be) Len() int { return 1 }
// Get returns the decoded value.
func (b *I8be) Get() int8 {
return int8(b[0])
}
// Set encodes a new value into the backing buffer:
func (b *I8be) Set(v int8) {
b[0] = byte(v)
}
// I16be wraps a byte array into a big endian encoded 16bit signed integer.
type I16be [2]byte
// Len returns the number of bytes required to store the value.
func (b *I16be) Len() int { return 2 }
// Get returns the decoded value.
func (b *I16be) Get() int16 {
return int16(binary.BigEndian.Uint16(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *I16be) Set(v int16) {
binary.BigEndian.PutUint16(b[:], uint16(v))
}
// I32be wraps a byte array into a big endian encoded 32bit signed integer.
type I32be [4]byte
// Len returns the number of bytes required to store the value.
func (b *I32be) Len() int { return 4 }
// Get returns the decoded value.
func (b *I32be) Get() int32 {
return int32(binary.BigEndian.Uint32(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *I32be) Set(v int32) {
binary.BigEndian.PutUint32(b[:], uint32(v))
}
// I64be wraps a byte array into a big endian encoded 64bit signed integer.
type I64be [8]byte
// Len returns the number of bytes required to store the value.
func (b *I64be) Len() int { return 8 }
// Get returns the decoded value.
func (b *I64be) Get() int64 {
return int64(binary.BigEndian.Uint64(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *I64be) Set(v int64) {
binary.BigEndian.PutUint64(b[:], uint64(v))
}
// U8be wraps a byte array into a big endian encoded 8bit unsigned integer.
type U8be [1]byte
// Len returns the number of bytes required to store the value.
func (b *U8be) Len() int { return 1 }
// Get returns the decoded value.
func (b *U8be) Get() uint8 {
return uint8(b[0])
}
// Set encodes a new value into the backing buffer:
func (b *U8be) Set(v uint8) {
b[0] = byte(v)
}
// U16be wraps a byte array into a big endian encoded 16bit unsigned integer.
type U16be [2]byte
// Len returns the number of bytes required to store the value.
func (b *U16be) Len() int { return 2 }
// Get returns the decoded value.
func (b *U16be) Get() uint16 {
return uint16(binary.BigEndian.Uint16(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *U16be) Set(v uint16) {
binary.BigEndian.PutUint16(b[:], uint16(v))
}
// U32be wraps a byte array into a big endian encoded 32bit unsigned integer.
type U32be [4]byte
// Len returns the number of bytes required to store the value.
func (b *U32be) Len() int { return 4 }
// Get returns the decoded value.
func (b *U32be) Get() uint32 {
return uint32(binary.BigEndian.Uint32(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *U32be) Set(v uint32) {
binary.BigEndian.PutUint32(b[:], uint32(v))
}
// U64be wraps a byte array into a big endian encoded 64bit unsigned integer.
type U64be [8]byte
// Len returns the number of bytes required to store the value.
func (b *U64be) Len() int { return 8 }
// Get returns the decoded value.
func (b *U64be) Get() uint64 {
return uint64(binary.BigEndian.Uint64(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *U64be) Set(v uint64) {
binary.BigEndian.PutUint64(b[:], uint64(v))
}
// I8le wraps a byte array into a little endian encoded 8bit signed integer.
type I8le [1]byte
// Len returns the number of bytes required to store the value.
func (b *I8le) Len() int { return 1 }
// Get returns the decoded value.
func (b *I8le) Get() int8 {
return int8(b[0])
}
// Set encodes a new value into the backing buffer:
func (b *I8le) Set(v int8) {
b[0] = byte(v)
}
// I16le wraps a byte array into a little endian encoded 16bit signed integer.
type I16le [2]byte
// Len returns the number of bytes required to store the value.
func (b *I16le) Len() int { return 2 }
// Get returns the decoded value.
func (b *I16le) Get() int16 {
return int16(binary.LittleEndian.Uint16(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *I16le) Set(v int16) {
binary.LittleEndian.PutUint16(b[:], uint16(v))
}
// I32le wraps a byte array into a little endian encoded 32bit signed integer.
type I32le [4]byte
// Len returns the number of bytes required to store the value.
func (b *I32le) Len() int { return 4 }
// Get returns the decoded value.
func (b *I32le) Get() int32 {
return int32(binary.LittleEndian.Uint32(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *I32le) Set(v int32) {
binary.LittleEndian.PutUint32(b[:], uint32(v))
}
// I64le wraps a byte array into a little endian encoded 64bit signed integer.
type I64le [8]byte
// Len returns the number of bytes required to store the value.
func (b *I64le) Len() int { return 8 }
// Get returns the decoded value.
func (b *I64le) Get() int64 {
return int64(binary.LittleEndian.Uint64(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *I64le) Set(v int64) {
binary.LittleEndian.PutUint64(b[:], uint64(v))
}
// U8le wraps a byte array into a little endian encoded 8bit unsigned integer.
type U8le [1]byte
// Len returns the number of bytes required to store the value.
func (b *U8le) Len() int { return 1 }
// Get returns the decoded value.
func (b *U8le) Get() uint8 {
return uint8(b[0])
}
// Set encodes a new value into the backing buffer:
func (b *U8le) Set(v uint8) {
b[0] = byte(v)
}
// U16le wraps a byte array into a little endian encoded 16bit unsigned integer.
type U16le [2]byte
// Len returns the number of bytes required to store the value.
func (b *U16le) Len() int { return 2 }
// Get returns the decoded value.
func (b *U16le) Get() uint16 {
return uint16(binary.LittleEndian.Uint16(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *U16le) Set(v uint16) {
binary.LittleEndian.PutUint16(b[:], uint16(v))
}
// U32le wraps a byte array into a little endian encoded 32bit unsigned integer.
type U32le [4]byte
// Len returns the number of bytes required to store the value.
func (b *U32le) Len() int { return 4 }
// Get returns the decoded value.
func (b *U32le) Get() uint32 {
return uint32(binary.LittleEndian.Uint32(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *U32le) Set(v uint32) {
binary.LittleEndian.PutUint32(b[:], uint32(v))
}
// U64le wraps a byte array into a little endian encoded 64bit unsigned integer.
type U64le [8]byte
// Len returns the number of bytes required to store the value.
func (b *U64le) Len() int { return 8 }
// Get returns the decoded value.
func (b *U64le) Get() uint64 {
return uint64(binary.LittleEndian.Uint64(b[:]))
}
// Set encodes a new value into the backing buffer:
func (b *U64le) Set(v uint64) {
binary.LittleEndian.PutUint64(b[:], uint64(v))
}