func (b *Reader) ResetBuffer(r io.Reader, buf []byte) {
	b.reset(buf, r)
}
ResetBuffer discards any buffered data, resets all state, and switches
the buffered reader to read from r.
package bufio
import (
	"bytes"
	"errors"
	"io"
)
const (
	defaultBufSize = 4096
)
var (
	ErrInvalidUnreadByte = errors.New("bufio: invalid use of UnreadByte")
	ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune")
	ErrBufferFull = errors.New("bufio: buffer full")
	ErrNegativeCount = errors.New("bufio: negative count")
)
type Reader struct {
	buf  []byte
	rd   io.Reader  
	r, w int        
	err  error
}
const minReadBufferSize = 16
const maxConsecutiveEmptyReads = 100
func NewReaderSize(rd io.Reader, size int) *Reader {
	b, ok := rd.(*Reader)
	if ok && len(b.buf) >= size {
		return b
	}
	if size < minReadBufferSize {
		size = minReadBufferSize
	}
	r := new(Reader)
	r.reset(make([]byte, size), rd)
	return r
}
func NewReader(rd io.Reader) *Reader {
	return NewReaderSize(rd, defaultBufSize)
}
func (b *Reader) Reset(r io.Reader) {
	b.reset(b.buf, r)
}