code: func NewControlWriterBuffer(dest io.Writer, state ws.State, op ws.OpCode, buf []byte) *ControlWriter {
  	max := ws.MaxControlFramePayloadSize + headerSize(state, ws.MaxControlFramePayloadSize)
  	if len(buf) > max {
  		buf = buf[:max]
  	}
  
  	w := NewWriterBuffer(dest, state, op, buf)
  
  	return &ControlWriter{
  		w:     w,
  		limit: len(w.buf),
  	}
  }
docs: // NewControlWriterBuffer returns a new ControlWriter with buf as a buffer.
  //
  // Note that it reserves x bytes of buf for header data, where x could be
  // ws.MinHeaderSize or ws.MinHeaderSize+4 (depending on state). At most
  // (ws.MaxControlFramePayloadSize + x) bytes of buf will be used.
  //
  // It panics if len(buf) <= ws.MinHeaderSize + x.