// WriteBE64 writes 64 bits in native format to the RWops as big-endian data.
// (https://wiki.libsdl.org/SDL_WriteBE64)
352977
func (rwops *RWops) WriteBE64(value uint64) uint {
	if rwops == nil {
		return 0
	}
	return uint(C.SDL_WriteBE64(rwops.cptr(), C.Uint64(value)))
}
44980
func (pl *Payload) WriteBinary(w io.Writer) error {
	enc := gob.NewEncoder(w)
	return pl.EncodeBinary(enc)
}
834662
func WriteBloomBits(db ethdb.Writer, bit uint, section uint64, head common.Hash, bits []byte) {
	if err := db.Put(bloomBitsKey(bit, section, head), bits); err != nil {
		log.Crit("Failed to store bloom bits", "err", err)
	}
}
1109237
func eb32(bits uint32, hi uint8, lo uint8) uint32 {
	m := uint32(((1 << (hi - lo)) - 1) << lo)
	return (bits & m) >> lo
}
1185966
func WriteFloat64(buf io.Writer, v float64) (n int, err error) {
	bits := math.Float64bits(v)
	bits = bits ^ (-(bits >> 63) | (1 << 63))
	data := make([]byte, 8)
	binary.BigEndian.PutUint64(data, bits)
	return buf.Write(data)
}
29994
func (rwops *RWops) WriteBE16(value uint16) uint {
	if rwops == nil {
		return 0
	}
	return uint(C.SDL_WriteBE16(rwops.cptr(), C.Uint16(value)))
}
100314
func (cmd *baseCommand) WriteUint64(num uint64) (int, error) {
	binary.BigEndian.PutUint64(cmd.dataBuffer[cmd.dataOffset:cmd.dataOffset+8], num)
	cmd.dataOffset += 8
	return 8, nil
}
342135
func (b *ByteBuf) WriteInt64(v int64) (n int, err error) {
	b.Expansion(8)
	Int64ToBytesTo(v, b.buf[b.writerIndex:b.writerIndex+8])
	b.writerIndex += 8
	return 8, nil
}
777428
func (aw *Writer) Write(b []byte) (n int, err error) {
	if int64(len(b)) > aw.nb {
		b = b[0:aw.nb]
		err = ErrWriteTooLong
	}
	n, werr := aw.w.Write(b)
	aw.nb -= int64(n)
	if werr != nil {
		return n, werr
	}

	if len(b)%2 == 1 { // data size must be aligned to an even byte
		n2, _ := aw.w.Write([]byte{'\n'})
		return n+n2, err
	}

	return
}
511138
func (enc *Encoder) WriteFloat32(n float32) error {
	bits := math.Float32bits(n)
	enc.err = enc.buf.WriteByte(byte(bits >> 24))
	if enc.err == nil {
		enc.err = enc.buf.WriteByte(byte(bits >> 16))
		if enc.err == nil {
			enc.err = enc.buf.WriteByte(byte(bits >> 8))
			if enc.err == nil {
				enc.err = enc.buf.WriteByte(byte(bits))
			}
		}
	}
	return enc.err
}
802530
func (rwops *RWops) ReadBE16() uint16 {
	if rwops == nil {
		return 0
	}
	return uint16(C.SDL_ReadBE16(rwops.cptr()))
}
173412
func (r *Encoder) EncodeInt64(x int64) error {
	_, err := r.w.Write([]byte{CHR_INT8})
	if err != nil {
		return err
	}
	return binary.Write(r.w, binary.BigEndian, x)
}
272314
func (be *BinaryEncoder) WriteInt16(value int16) {
	binary.BigEndian.PutUint16(be.buffer[be.pos:], uint16(value))
	be.pos += 2
}
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
}
831694
func (cmd *baseCommand) WriteInt64(num int64) (int, error) {
	return cmd.WriteUint64(uint64(num))
}
888200
func (display *HD44780) write4bits(data byte, mode byte) {
	// map the 4 low bits of data into d
	var d byte = 0
	if data&0x08 != 0 {
		d |= display.d7
	}
	if data&0x04 != 0 {
		d |= display.d6
	}
	if data&0x02 != 0 {
		d |= display.d5
	}
	if data&0x01 != 0 {
		d |= display.d4
	}
	display.expanderWrite(d | mode)
	display.pulseEnable(d | mode)
}
119645
func (vb *keyWriter) WriteInt64(num int64) (int, error) {
	return vb.WriteUint64(uint64(num))
}