peekByte returns the next byte. When retain is false, fully consumed chunks are discarded before reading more data. SYS-REQ-116
(retain bool)
| 607 | // are discarded before reading more data. |
| 608 | // SYS-REQ-116 |
| 609 | func (rp *ReaderParser) peekByte(retain bool) (byte, error) { |
| 610 | for rp.pos >= len(rp.buf) { |
| 611 | if !retain { |
| 612 | rp.discardConsumed() |
| 613 | } |
| 614 | if err := rp.readMore(); err != nil { |
| 615 | return 0, err |
| 616 | } |
| 617 | } |
| 618 | return rp.buf[rp.pos], nil |
| 619 | } |
| 620 | |
| 621 | // SYS-REQ-116 |
| 622 | func (rp *ReaderParser) readMore() error { |
no test coverage detected