-
Notifications
You must be signed in to change notification settings - Fork 0
/
byteorder.go
37 lines (29 loc) · 933 Bytes
/
byteorder.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
// Byteman
// For the full copyright and license information, please view the LICENSE.txt file.
package byteman
// ByteOrderType represents the byte order type.
type ByteOrderType uint8
const (
// ByteOrderTypeLittleEndian represents the little-endian byte order type.
ByteOrderTypeLittleEndian ByteOrderType = 0
// ByteOrderTypeBigEndian represents the big-endian byte order type.
ByteOrderTypeBigEndian ByteOrderType = 1
)
// ByteOrder provides interface for endianness.
type ByteOrder interface {
Type() ByteOrderType
}
// LittleEndian represents the little-endian byte order.
type LittleEndian struct {
}
// Type returns the byte order type.
func (bo *LittleEndian) Type() ByteOrderType {
return ByteOrderTypeLittleEndian
}
// BigEndian represents the big-endian byte order.
type BigEndian struct {
}
// Type returns the byte order type.
func (bo *BigEndian) Type() ByteOrderType {
return ByteOrderTypeBigEndian
}