func (b *Bytes) WriteString(s string) (int, error) {
	n := b.Len()
	b.grow(n + len(s))
	copy((*b.p)[n:], s)
	return len(s), nil
}
WriteString writes s to b and returns (len(s), nil).
package buffer
import (
	"github.com/cznic/internal/slice"
	"io"
)
func CGet(size int) *[]byte { return slice.Bytes.CGet(size).(*[]byte) }
func Get(size int) *[]byte { return slice.Bytes.Get(size).(*[]byte) }
func Put(p *[]byte) { slice.Bytes.Put(p) }
type Bytes struct {
	p *[]byte
}
func (b *Bytes) Bytes() []byte {
	if b.p != nil {
		return *b.p
	}
	return nil
}
func (b *Bytes) Close() error {
	if b.p != nil {
		Put(b.p)
		b.p = nil
	}
	return nil
}
func (b *Bytes) Len() int {
	if b.p != nil {
		return len(*b.p)
	}
	return 0
}
func (b *Bytes) Reset() {
	if b.p != nil {
		*b.p = (*b.p)[:0]
	}
}
func (b *Bytes) Write(p []byte) (int, error) {
	n := b.Len()
	b.grow(n + len(p))
	copy((*b.p)[n:], p)
	return len(p), nil
}
func (b *Bytes) WriteByte(p byte) error {
	n := b.Len()
	b.grow(n + 1)
	(*b.p)[n] = p
	return nil
}
func (b *Bytes) WriteTo(w io.Writer) (int64, error) {
	n, err := w.Write(b.Bytes())
	return int64(n), err
}