ReadIntBytes tries to read an int from 'b' and return the value and the remaining bytes. Possible errors: - [ErrShortBytes] (too few bytes) - [TypeError] (not a int) - [IntOverflow] (value doesn't fit in int; 32-bit platforms only)
(b []byte)
| 580 | // - [TypeError] (not a int) |
| 581 | // - [IntOverflow] (value doesn't fit in int; 32-bit platforms only) |
| 582 | func ReadIntBytes(b []byte) (int, []byte, error) { |
| 583 | if smallint { |
| 584 | i, b, err := ReadInt32Bytes(b) |
| 585 | return int(i), b, err |
| 586 | } |
| 587 | i, b, err := ReadInt64Bytes(b) |
| 588 | return int(i), b, err |
| 589 | } |
| 590 | |
| 591 | // ReadUint64Bytes tries to read a uint64 |
| 592 | // from 'b' and return the value and the remaining bytes. |
searching dependent graphs…