// Bytes converts a VarInt to a byte array
978991
func (x VarInt) Bytes() []byte {
	b := []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0} // 9.14 bytes are needed
	ux := uint64(x) << 1
	if x < 0 {
		ux = ^ux
	}
	pos := 0
	for {
		b[pos] = byte((ux & 0x7F) | 0x80)
		pos++
		if ux >= 128 {
			ux >>= 7
		} else {
			break
		}
	}
	b[pos-1] &= 0x7F
	return b[0:pos]
}
466615
func (blk *MeasurementBlock) bytes() int {
	var b int
	// Do not count contents of blk.data or blk.hashData because they reference into an external []byte
	b += int(unsafe.Sizeof(*blk))
	return b
}
1025221
func (h Headers) Bytes() []byte {
	b := make([]byte, 0, 1024)
	for i := 0; i < len(h); i += 2 {
		b = append(b, h[i]+":"+h[i+1]+"\n"...)
	}
	return b
}
950976
func (m *M) Bytes(mediatype string, v []byte) ([]byte, error) {
	out := buffer.NewWriter(make([]byte, 0, len(v)))
	if err := m.Minify(mediatype, out, buffer.NewReader(v)); err != nil {
		return v, err
	}
	return out.Bytes(), nil
}
863564
func (val Val) Bytes() []byte {
	return C.GoBytes(val.mv_data, C.int(val.mv_size))
}
981235
func (s *CatAllocationService) Bytes(bytes string) *CatAllocationService {
	s.bytes = bytes
	return s
}
70396
func Bytes(length int) []byte {
	out := make([]byte, length)
	if _, err := io.ReadFull(rand.Reader, out); err != nil {
		panic(err)
	}
	return out
}
172815
func (p *parserMixin) Bytes() (target *units.Base2Bytes) {
	target = new(units.Base2Bytes)
	p.BytesVar(target)
	return
}
621125
func (r *Rx) Bytes() (tx, rx []byte) {
	return r.tx.Bytes(), r.rx.Bytes()
}
25596
func (o Offset) Bytes() []byte {
	valBytes := make([]byte, 8)
	encoding.PutUint64(valBytes, o.LogOffset)

	l := commitlog.NewLogFromEntry(commitlog.LogEntry{
		Key:       []byte(o.Namespace),
		Value:     valBytes,
		Timestamp: uint64(o.Timestamp),
	})
	return l
}
1045099
func Bytes(val string) ([]byte, error) {
	b, err := base64.StdEncoding.DecodeString(val)
	if err != nil {
		b, err = base64.URLEncoding.DecodeString(val)
		if err != nil {
			return nil, err
		}
	}
	return b, nil
}
1147494
func (e *IntegerEncoder) Bytes() ([]byte, error) {
	// Only run-length encode if it could reduce storage size.
	if e.rle && len(e.values) > 2 {
		return e.encodeRLE()
	}

	for _, v := range e.values {
		// Value is too large to encode using packed format
		if v > simple8b.MaxValue {
			return e.encodeUncompressed()
		}
	}

	return e.encodePacked()
}
803971
func (udh *UDH) Bytes() []byte {
	var ret []byte
	ret = append(ret, udh.IEI.Bytes()...)
	ret = append(ret, udh.IELength.Bytes()...)
	ret = append(ret, udh.IEData.Bytes()...)
	return ret
}
948259
func Bytes(dst, src0, src1 []byte) {
	size := len(dst)
	if size > len(src0) {
		size = len(src0)
	}
	if size > len(src1) {
		size = len(src1)
	}
	xorBytes(dst, src0, src1, size)
}
840568
func Bytes(s string) []byte {
	if !Enable {
		return []byte(s)
	}
	pstring := (*reflect.StringHeader)(unsafe.Pointer(&s))
	return BytesFromPtr(pstring.Data, pstring.Len)
}
80731
func (c Context) Bytes(key string, val []byte) Context {
	c.l.context = enc.AppendBytes(enc.AppendKey(c.l.context, key), val)
	return c
}
1319077
func (r *Request) Bytes() ([]byte, error) {
	if r.body != nil {
		return r.body, nil
	}
	resp, err := r.getResponse()
	if err != nil {
		return nil, err
	}
	if resp.Body == nil {
		return nil, nil
	}
	defer resp.Body.Close()
	data, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}
	r.body = data
	return data, nil
}