returns the number of bytes skipped and an error, in case the string is longer than the input slice
(b []byte)
| 546 | // returns the number of bytes skipped and an error, in case the string is |
| 547 | // longer than the input slice |
| 548 | func skipLengthEncodedString(b []byte) (int, error) { |
| 549 | // Get length |
| 550 | num, _, n := readLengthEncodedInteger(b) |
| 551 | if num < 1 { |
| 552 | return n, nil |
| 553 | } |
| 554 | |
| 555 | n += int(num) |
| 556 | |
| 557 | // Check data length |
| 558 | if len(b) >= n { |
| 559 | return n, nil |
| 560 | } |
| 561 | return n, io.EOF |
| 562 | } |
| 563 | |
| 564 | // returns the number read, whether the value is NULL and the number of bytes read |
| 565 | func readLengthEncodedInteger(b []byte) (uint64, bool, int) { |
no test coverage detected