// IntBytes returns an array of bytes of the snowflake ID, encoded as a
// big endian integer.
435239
func (f ID) IntBytes() [8]byte {
	var b [8]byte
	binary.BigEndian.PutUint64(b[:], uint64(f))
	return b
}
169838
func ParseBytes(id []byte) (ID, error) {
	i, err := strconv.ParseInt(string(id), 10, 64)
	return ID(i), err
}
527180
func uint32ToBytes(number uint32) []byte {
	buf := make([]byte, 4)
	binary.LittleEndian.PutUint32(buf, number)
	return buf
}
790987
func FormatBytes(i int64) (result string) {
	switch {
	case i > (1024 * 1024 * 1024 * 1024):
		result = fmt.Sprintf("%.02f TiB", float64(i)/1024/1024/1024/1024)
	case i > (1024 * 1024 * 1024):
		result = fmt.Sprintf("%.02f GiB", float64(i)/1024/1024/1024)
	case i > (1024 * 1024):
		result = fmt.Sprintf("%.02f MiB", float64(i)/1024/1024)
	case i > 1024:
		result = fmt.Sprintf("%.02f KiB", float64(i)/1024)
	default:
		result = fmt.Sprintf("%d B", i)
	}
	result = strings.Trim(result, " ")
	return
}
1265107
func (p *TCompactProtocol) bytesToInt64(b []byte) int64 {
	return int64(binary.LittleEndian.Uint64(b))
}
1268753
func Int32(b []byte) int32 {
	if l := len(b); l != 4 {
		panic(fmt.Sprintf("Int32: unexpected byte slice length: %d", l))
	}

	return *(*int32)(unsafe.Pointer(&b[0]))
}
997551
func WriteBytes(w io.Writer, data []byte, offset int, count int) error {

	_, err := w.Write(data[offset : offset+count])
	if err != nil {
		return err
	}
	return nil
}
614127
func uint64ToBytes(u uint64) []byte {
	buf := make([]byte, 8)
	binary.BigEndian.PutUint64(buf, u)
	return buf
}
998690
func getBytes(raw string) []byte {
	rawSlice := strings.FieldsFunc(raw, isArray)
	result := make([]byte, len(rawSlice))

	i := 0
	for _, b := range rawSlice {
		fmt.Sscan(b, &result[i])
		i++
	}
	return result
}
1301826
func intToBytes(bi *big.Int) (bs []byte) {
	base := big.NewInt(256)
	for bi.Cmp(base) >= 0 {
		i := new(big.Int).Mod(bi, base).Int64()
		bs = append(bs, byte(i))
		bi.Sub(bi, base)
		bi.Div(bi, base)
	}
	bs = append(bs, byte(bi.Int64()))
	return bs
}
692264
func FromBytes(b []byte) (ID, error) {
	var id ID
	if len(b) != rawLen {
		return id, ErrInvalidID
	}
	copy(id[:], b)
	return id, nil
}
403210
func intToBytes(n int) []byte {
	buf := make([]byte, 3)
	buf[0] = byte((n >> 16) & 0xFF)
	buf[1] = byte((n >> 8) & 0xFF)
	buf[2] = byte(n & 0xFF)
	return buf
}
594174
func (se *SizingEncoder) WriteBytes(value []byte) {
	se.WriteInt32(int32(len(value)))
	se.size += len(value)
}
875873
func Uint8Bytes(v uint8) []byte {
	b := make([]byte, 1)
	PutUint8(b, v)
	return b
}
822938
func (s *InMemorySender) TotalBytesSent() int64 {
	s.mutex.RLock()
	defer s.mutex.RUnlock()
	return s.totalBytesSent
}
815318
func (s *ConnStats) incInputBytes(n int) {
	s.totalInputBytes.Add(uint64(n))
}
896095
func (enc *Encoder) writeBytes(p []byte) {
	enc.buf = append(enc.buf, p...)
}