code: func NewWriterBuffer(dest io.Writer, state ws.State, op ws.OpCode, buf []byte) *Writer {
  	offset := reserve(state, len(buf))
  	if len(buf) <= offset {
  		panic("buffer too small")
  	}
  
  	return &Writer{
  		dest:  dest,
  		raw:   buf,
  		buf:   buf[offset:],
  		state: state,
  		op:    op,
  	}
  }
docs: // NewWriterBuffer returns a new Writer with buf as a buffer.
  //
  // Note that it reserves x bytes of buf for header data, where x is in range
  // [ws.MinHeaderSize,ws.MaxHeaderSize] (depending on state and buf size).
  //
  // You could use ws.HeaderSize() to calculate number of bytes needed to store
  // header data.
  //
  // It panics if len(buf) is too small to fit header and payload data.