func (b *Buffer) UntilSymbol(s uint8, errOnEnd bool) ([]byte, error) {
	if b.err != nil {
		return nil, b.err
	}
	data := b.data[b.offset:]
	for i, byte := range data {
		if byte == s {
			data := b.data[b.mark : b.offset+i]
			b.Advance(len(data))
			return data, nil
		}
	}
	if errOnEnd {
		b.offset += len(data)
		return nil, b.bufferEndError()
	} else {
		data := b.data[b.mark:]
		b.Advance(len(data))
		return data, nil
	}
}
UntilSymbol collects all bytes until symbol s is found. If errOnEnd is set to
true, the collected byte slice will be returned if no more bytes are available
for parsing, but s has not matched yet.
package streambuf
import (
	"bytes"
	"errors"
)
var ErrExpectedDigit = errors.New("Expected digit")
func (b *Buffer) UntilCRLF() ([]byte, error) {
	if b.err != nil {
		return nil, b.err
	}
	data := b.data[b.offset:]
	for i, byte := range data {
		if byte != '\r' {
			continue
		}
		if len(data) < i+2 {
			b.offset += i
			return nil, b.bufferEndError()
		}
		if data[i+1] != '\n' {
			continue
		}
		end := i
		data = b.data[b.mark : b.offset+end]
		b.Advance(len(data) + 2)
		return data, nil
	}
	b.offset += len(data)
	return nil, b.bufferEndError()
}
func (b *Buffer) IgnoreSymbol(s uint8) error {
	if b.err != nil {
		return b.err
	}
	data := b.data[b.offset:]
	for i, byte := range data {
		if byte != s {
			b.Advance(b.offset + i - b.mark)
			return nil
		}
	}
	b.offset += len(data)
	return b.bufferEndError()
}
func (b *Buffer) IgnoreSymbols(syms []byte) error {
	if b.err != nil {
		return b.err
	}
	data := b.data[b.offset:]
	for i, byte := range data {
		for _, other := range syms {
			if byte == other {
				goto next
			}
		}
		b.Advance(b.offset + i - b.mark)
		return nil
	next:
	}
	b.offset += len(data)
	return b.bufferEndError()
}