func (b *bufioR) require(sz int) error {
	extra := sz - b.Buffered()
	if extra < 1 {
		return nil
	}

	// compact first
	b.compact()

	// grow the buffer if necessary
	if n := b.w + extra; n > len(b.buf) {
		buf := make([]byte, n)
		copy(buf, b.buf[:b.w])
		b.buf = buf
	}

	// read data into buffer
	n, err := io.ReadAtLeast(b.rd, b.buf[b.w:], extra)
	b.w += n
	return err
}
// require ensures that sz bytes are buffered
require ensures that sz bytes are buffered
// require ensures that sz bytes are buffered
func (b *bufioR) require(sz int) error {
	extra := sz - b.Buffered()
	if extra < 1 {
		return nil
	}
	b.compact()
	if n := b.w + extra; n > len(b.buf) {
		buf := make([]byte, n)
		copy(buf, b.buf[:b.w])
		b.buf = buf
	}
	n, err := io.ReadAtLeast(b.rd, b.buf[b.w:], extra)
	b.w += n
	return err
}
func ( b * bufioR ) require ( sz int ) error { extra := sz - b . Buffered ( ) if extra < 1 { return nil } b . compact ( ) if n := b . w + extra ; n > len ( b . buf ) { buf := make ( [ ] byte , n ) copy ( buf , b . buf [ : b . w ] ) b . buf = buf } n , err := io . ReadAtLeast ( b . rd , b . buf [ b . w : ] , extra ) b . w += n return err }
require ensures that sz bytes are buffered
require ensures that sz bytes are buffered
// compact first // grow the buffer if necessary // read data into buffer