// Write an I16 as a zigzag varint.
770174
func (p *TCompactProtocol) WriteI16(value int16) error {
	_, err := p.writeVarint32(p.int32ToZigzag(int32(value)))
	return NewTProtocolException(err)
}
1087869
func _putStr16(in string, out []byte) int {
	binary.BigEndian.PutUint16(out, uint16(len(in)))
	return copy(out[2:], in) + 2
}
857358
func (s *SyslogWrapper) Write(p []byte) (int, error) {
	// Skip syslog if the log level doesn't apply
	if !s.filt.Check(p) {
		return 0, nil
	}

	// Extract log level
	var level string
	afterLevel := p
	x := bytes.IndexByte(p, '[')
	if x >= 0 {
		y := bytes.IndexByte(p[x:], ']')
		if y >= 0 {
			level = string(p[x+1 : x+y])
			afterLevel = p[x+y+2:]
		}
	}

	// Each log level will be handled by a specific syslog priority
	priority, ok := levelPriority[level]
	if !ok {
		priority = gsyslog.LOG_NOTICE
	}

	// Attempt the write
	err := s.l.WriteLevel(priority, afterLevel)
	return len(p), err
}
455892
func (b *Buffer) Write16(v uint16) {
	order.PutUint16(b.append(2), v)
}
883042
func (w *ByteWriter) WriteInt32(val int32, offset int) (int, error) {
	return w.WriteVal(val, offset)
}
401773
func (c *IdleTimingConn) Write(b []byte) (int, error) {
	c.closeMutex.RLock()
	n, err := c.doWrite(b)
	c.closeMutex.RUnlock()
	return n, err
}
1287880
func (stream *Stream) WriteUint16(val uint16) {
	q1 := val / 1000
	if q1 == 0 {
		stream.buf = writeFirstBuf(stream.buf, digits[val])
		return
	}
	r1 := val - q1*1000
	stream.buf = writeFirstBuf(stream.buf, digits[q1])
	stream.buf = writeBuf(stream.buf, digits[r1])
	return
}
853208
func (ui UgenInput) Write(w io.Writer) error {
	if we := binary.Write(w, byteOrder, ui.UgenIndex); we != nil {
		return we
	}
	return binary.Write(w, byteOrder, ui.OutputIndex)
}
4232
func WriteVarInt64(w io.Writer, i int64) error {
	var b []byte
	_, err := w.Write(appendSleb128(b, i))
	return err
}
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
}
938502
func (e Encoder) AppendInt16(dst []byte, val int16) []byte {
	return e.AppendInt(dst, int(val))
}
762349
func (vb *packer) WriteInt16(num int16) (int, error) {
	return vb.WriteUint16(uint16(num))
}
737629
func (w *Writer) WriteInt(i int64) {
	if i >= 0 && i <= 9 {
		w.writeByte(byte('0' + i))
		return
	}
	if i >= math.MinInt32 && i <= math.MaxInt32 {
		w.writeByte(TagInteger)
	} else {
		w.writeByte(TagLong)
	}
	var buf [20]byte
	w.write(util.GetIntBytes(buf[:], i))
	w.writeByte(TagSemicolon)
}
375534
func SubI8x16(x, y I8x16) I8x16 {
	val := I8x16{}
	for i := 0; i < 16; i++ {
		val[i] = x[i] - y[i]
	}
	return val
}
449822
func (b *ByteBuf) WriteUInt16(v uint16) (n int, err error) {
	b.Expansion(2)
	Uint16ToBytesTo(v, b.buf[b.writerIndex:b.writerIndex+2])
	b.writerIndex += 2
	return 2, nil
}
119645
func (vb *keyWriter) WriteInt64(num int64) (int, error) {
	return vb.WriteUint64(uint64(num))
}
189195
func (w *Writer) WriteUint(i uint64) {
	if i <= 9 {
		w.writeByte(byte('0' + i))
		return
	}
	if i <= math.MaxInt32 {
		w.writeByte(TagInteger)
	} else {
		w.writeByte(TagLong)
	}
	var buf [20]byte
	w.write(util.GetUintBytes(buf[:], i))
	w.writeByte(TagSemicolon)
}