// WriteInt write int value to buf using big order
// return write bytes count, error
972422
func (b *ByteBuf) WriteInt(v int) (n int, err error) {
	b.Expansion(4)
	Int2BytesTo(v, b.buf[b.writerIndex:b.writerIndex+4])
	b.writerIndex += 4
	return 4, nil
}
119645
func (vb *keyWriter) WriteInt64(num int64) (int, error) {
	return vb.WriteUint64(uint64(num))
}
948139
func (be *BinaryEncoder) WriteInt8(value int8) {
	be.buffer[be.pos] = byte(value)
	be.pos++
}
324034
func (b *basicWriter) Write(buf []byte) (int, error) {
	b.maybeWriteHeader()
	return b.ResponseWriter.Write(buf)
}
931023
func (buf *Buffer) WriteByte(b byte) error {
	buf.bytes = append(buf.bytes, b)
	return nil
}
831694
func (cmd *baseCommand) WriteInt64(num int64) (int, error) {
	return cmd.WriteUint64(uint64(num))
}
480339
func (enc *Encoder) WriteInt(n int) error {
	return enc.writeUnsigned((n << 1) ^ (n >> 31))
}
418065
func (w *writer) pushInt(i int) {
	w.intStack = append(w.intStack, i)
}
687186
func (b *builderBuffer) WriteBytes(v byte, count uint) {
	if count == 0 {
		return
	}
	off := uint(len(*b))
	b.growCapacity(count)
	*b = (*b)[:off+count]
	for i := uint(0); i < count; i++ {
		(*b)[off+i] = v
	}
}
1123665
func (ed *eventData) writeInt8(value int8) {
	ed.buffer.WriteByte(uint8(value))
}
105576
func (w *countingWriter) Write(p []byte) (n int, err error) {
	n, err = w.w.Write(p)
	w.count += uint(n)
	return n, err
}
338671
func (b *Buffer) Write(p []byte) (n int, err error) {
	m := b.grow(len(p))
	return copy(b.buf[m:], p), nil
}
706341
func (ed *eventData) writeInt64(value int64) {
	binary.Write(&ed.buffer, binary.LittleEndian, value)
}
442967
func (w *Writer) WriteInt(i int) {
	fmt.Fprintf(w.w, ":%d\r\n", i)
}
1263444
func WriteBytes(buf io.ByteWriter, data []byte) (n int, err error) {
	wb := func(b byte) (err error) {
		if err = buf.WriteByte(b); err == nil {
			n++
		}
		return
	}

	acc := byte(0)
	for i := 0; i < len(data); i++ {
		m := uint(i % 7)
		b := data[i]
		if err = wb(acc | 1 | ((b & (0xff << (m + 1))) >> m)); err != nil {
			return
		}
		acc = (b << (7 - m))
		if m == 6 {
			if err = wb(acc | 1); err != nil {
				return
			}
			acc = 0
		}
	}
	err = wb(acc)
	return
}
1124548
func (b *ByteBuf) Write(p []byte) (int, error) {
	n := len(p)
	b.Expansion(n)
	copy(b.buf[b.writerIndex:], p)
	b.writerIndex += n
	return n, nil
}
324226
func (file *File) Write(buf []byte) (int, error) {
	n, err := file.WriteAt(buf, int64(file.offset))
	if err == nil {
		file.offset += uint64(n)
	}

	return n, err
}