// WriteComplex64 to the writer
199434
func (w *Writer) WriteComplex64(c complex64) {
	if imag(c) == 0 {
		w.WriteFloat(float64(real(c)), 32)
		return
	}
	setWriterRef(w, nil, nil)
	writeListHeader(w, 2)
	w.WriteFloat(float64(real(c)), 32)
	w.WriteFloat(float64(imag(c)), 32)
	writeListFooter(w)
}
909751
func (w *WrapWriter) Write(p []byte) (n int, err error) {
	n, err = Wrap(w, p, w.off, w.wrapAt)
	w.off = (w.off + int64(n)) % w.wrapAt
	return n, err
}
624109
func (w *Writer) Write(b []byte) (int, error) {
	n := len(b)
	end := len(w.buf)
	if end+n > cap(w.buf) {
		buf := make([]byte, end, 2*cap(w.buf)+n)
		copy(buf, w.buf)
		w.buf = buf
	}
	w.buf = w.buf[:end+n]
	return copy(w.buf[end:], b), nil
}
51616
func (w *ByteWriter) MustWriteFloat64(val float64, offset int) int {
	return w.MustWriteVal(val, offset)
}
280040
func (w *FuncWriter) Write(b []byte) (int, error) {
	w.fx(b)
	return len(b), nil
}
298432
func (p *TCompactProtocol) writeVarint64(n int64) (int, error) {
	varint64out := make([]byte, 10)
	idx := 0
	for {
		if (n & ^0x7F) == 0 {
			varint64out[idx] = byte(n)
			idx++
			break
		} else {
			varint64out[idx] = byte((n & 0x7F) | 0x80)
			idx++
			u := uint64(n)
			n = int64(u >> 7)
		}
	}
	return p.trans.Write(varint64out[0:idx])
}
295158
func Write(w io.Writer, data ...interface{}) error {
	for _, v := range data {
		if err := binary.Write(w, binary.BigEndian, v); err != nil {
			return err
		}
	}

	return nil
}
1200229
func (s *Writer) Write(b []byte) (int, error) {
	if s.limiter == nil {
		return s.w.Write(b)
	}

	n, err := s.w.Write(b)
	if err != nil {
		return n, err
	}

	if err := s.limiter.WaitN(s.ctx, n); err != nil {
		return n, err
	}
	return n, err
}
144613
func (m *Message) writeBase64(w io.Writer, total int64) (int64, error) {
	written, err := io.WriteString(w, "Content-Transfer-Encoding: base64\r\n\r\n")
	total += int64(written)
	if err != nil {
		return total, err
	}
	// must wrap content at 76 characters
	b64Writer := base64.NewEncoder(base64.StdEncoding, &base64Writer{w: w, maxLineLen: MaxBodyLineLength})
	written, err = b64Writer.Write(m.Body)
	b64Writer.Close() // Must remember to close the wrapper, as it needs to flush to underlying writer
	return total + int64(written), err
}
343289
func (rwops *RWops) WriteU8(value uint8) uint {
	if rwops == nil {
		return 0
	}
	return uint(C.SDL_WriteU8(rwops.cptr(), C.Uint8(value)))
}
65371
func (w *Writer) Write(b []byte) error {
	w.Lock()
	defer w.Unlock()

	// TODO(abg): Bounds check?
	binary.BigEndian.PutUint32(w.buff[:], uint32(len(b)))
	if _, err := w.w.Write(w.buff[:]); err != nil {
		return err
	}

	if len(b) == 0 {
		return nil
	}

	_, err := w.w.Write(b)
	return err
}
503523
func (m *murmur32) Write(data []byte) (n int, err error) {
	n = len(data)
	m.size += uint32(n)

	data = m.mixTail(data)

	for l := len(data); l >= 4; l -= 4 {
		k := uint32(data[0]) | uint32(data[1])<<8 | uint32(data[2])<<16 | uint32(data[3])<<24
		m.hash, k = mmix(m.hash, k)
		data = data[4:]
	}

	m.mixTail(data) // data should be length 0 after this
	return
}
610299
func (stream *Stream) WriteFloat64(val float64) {
	abs := math.Abs(val)
	fmt := byte('f')
	// Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right.
	if abs != 0 {
		if abs < 1e-6 || abs >= 1e21 {
			fmt = 'e'
		}
	}
	stream.buf = strconv.AppendFloat(stream.buf, float64(val), fmt, -1, 64)
}
352977
func (rwops *RWops) WriteBE64(value uint64) uint {
	if rwops == nil {
		return 0
	}
	return uint(C.SDL_WriteBE64(rwops.cptr(), C.Uint64(value)))
}
706341
func (ed *eventData) writeInt64(value int64) {
	binary.Write(&ed.buffer, binary.LittleEndian, value)
}
1248380
func (w *minifyWriter) Write(b []byte) (int, error) {
	return w.pw.Write(b)
}
105863
func (out *DataOutputImpl) WriteLong(i int64) error {
	err := out.WriteInt(int32(i >> 32))
	if err == nil {
		err = out.WriteInt(int32(i))
	}
	return err
}