func (s *Static) Write(b []byte) (n int, err error) {
	offset := len(s.buf)
	size := offset + len(b)
	if size <= cap(s.buf) {
		s.buf = s.buf[:size]
	} else {
		s.buf = s.buf[:cap(s.buf)]
		err = io.EOF
	}
	n = copy(s.buf[offset:], b)
	return
}
Write doesn't panic.
package buffer
import (
	"encoding/binary"
	"io"
)
type Static struct {
	buf []byte
}
func MakeStatic(b []byte) Static {
	return Static{b}
}
func NewStatic(b []byte) *Static {
	s := MakeStatic(b)
	return &s
}
func (s *Static) Cap() int {
	return cap(s.buf)
}
func (s *Static) Len() int {
	return len(s.buf)
}
func (s *Static) Bytes() []byte {
	return s.buf
}