ReadNilBytes tries to read a "nil" byte off of 'b' and return the remaining bytes. Possible errors: - [ErrShortBytes] (too few bytes) - [TypeError] (not a 'nil') - [InvalidPrefixError]
(b []byte)
| 314 | // - [TypeError] (not a 'nil') |
| 315 | // - [InvalidPrefixError] |
| 316 | func ReadNilBytes(b []byte) ([]byte, error) { |
| 317 | if len(b) < 1 { |
| 318 | return nil, ErrShortBytes |
| 319 | } |
| 320 | if b[0] != mnil { |
| 321 | return b, badPrefix(NilType, b[0]) |
| 322 | } |
| 323 | return b[1:], nil |
| 324 | } |
| 325 | |
| 326 | // ReadFloat64Bytes tries to read a float64 |
| 327 | // from 'b' and return the value and the remaining bytes. |
searching dependent graphs…