AppendUint16 appends v to dst using little endian binary encoding using at most byteCount bytes.
(dst []byte, v uint16, byteCount uint8)
| 86 | |
| 87 | // AppendUint16 appends v to dst using little endian binary encoding using at most byteCount bytes. |
| 88 | func AppendUint16(dst []byte, v uint16, byteCount uint8) []byte { |
| 89 | switch byteCount { |
| 90 | case 0: |
| 91 | return dst |
| 92 | case 1: |
| 93 | return append(dst, byte(v)) |
| 94 | default: |
| 95 | dst = append(dst, byte(v), byte(v>>8)) |
| 96 | for i := uint8(2); i < byteCount; i++ { |
| 97 | dst = append(dst, 0) |
| 98 | } |
| 99 | return dst |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | // AppendUint32 appends v to dst using little endian binary encoding using at most byteCount bytes. |
| 104 | func AppendUint32(dst []byte, v uint32, byteCount uint8) []byte { |
no outgoing calls
no test coverage detected