DecodeUint16Ascending decodes a uint16 from the input buffer, treating the input as a big-endian 2 byte uint16 representation. The remainder of the input buffer and the decoded uint16 are returned.
(b []byte)
| 230 | // the input as a big-endian 2 byte uint16 representation. The remainder |
| 231 | // of the input buffer and the decoded uint16 are returned. |
| 232 | func DecodeUint16Ascending(b []byte) ([]byte, uint16, error) { |
| 233 | if len(b) < 2 { |
| 234 | return nil, 0, errors.Errorf("insufficient bytes to decode uint16 int value") |
| 235 | } |
| 236 | v := binary.BigEndian.Uint16(b) |
| 237 | return b[2:], v, nil |
| 238 | } |
| 239 | |
| 240 | // DecodeUint32Ascending decodes a uint32 from the input buffer, treating |
| 241 | // the input as a big-endian 4 byte uint32 representation. The remainder |
no test coverage detected
searching dependent graphs…