// Bytes returns a specific return parameter as a []byte.
// If a result has not been set, it returns nil.
9764
func (r *MockResult) Bytes(i int) []byte {
	if r.Contains(i) {
		if rr := r.Result[i]; rr == nil {
			return nil
		} else {
			return rr.([]byte)
		}
	} else {
		return nil
	}
}
368197
func (f File) Bytes() []byte {
	b, err := ioutil.ReadFile(f.Path)
	must(f.Case.T, err)
	return b
}
172815
func (p *parserMixin) Bytes() (target *units.Base2Bytes) {
	target = new(units.Base2Bytes)
	p.BytesVar(target)
	return
}
720767
func (r *Rand) Bytes(n int) []byte {
	// cRandBytes isn't guaranteed to be fast so instead
	// use random bytes generated from the internal PRNG
	bs := make([]byte, n)
	for i := 0; i < len(bs); i++ {
		bs[i] = byte(r.Int() & 0xFF)
	}
	return bs
}
234448
func (c *CSPRNG) Bytes(bytes int) ([]byte, error) {
	n := make([]byte, bytes)

	// get bytes-bit random number from /dev/urandom
	_, err := io.ReadFull(rand.Reader, n)
	if err != nil {
		return nil, err
	}

	return n, nil
}
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
}
418913
func (f Float) Bytes() []byte {
	var (
		buf = &bytes.Buffer{}
		_   = binary.Write(buf, byteOrder, float32(f)) // Never fails
	)
	return buf.Bytes()
}
840568
func Bytes(s string) []byte {
	if !Enable {
		return []byte(s)
	}
	pstring := (*reflect.StringHeader)(unsafe.Pointer(&s))
	return BytesFromPtr(pstring.Data, pstring.Len)
}
1177002
func (c Caser) Bytes(b []byte) []byte {
	return []byte(c.String(string(b)))
}
137056
func (b *Builder) Bytes() ([]byte, error) {
	if !b.IsClosed() {
		return nil, WithStack(BuilderNotClosedError)
	}
	return b.buf, nil
}
122119
func (h *HTTPBin) Bytes(w http.ResponseWriter, r *http.Request) {
	handleBytes(w, r, false)
}
536061
func Bytes(val interface{}) []byte {

	if val == nil {
		return []byte{}
	}

	switch t := val.(type) {

	case int:
		return int64ToBytes(int64(t))

	case int8:
		return int64ToBytes(int64(t))
	case int16:
		return int64ToBytes(int64(t))
	case int32:
		return int64ToBytes(int64(t))
	case int64:
		return int64ToBytes(int64(t))

	case uint:
		return uint64ToBytes(uint64(t))
	case uint8:
		return uint64ToBytes(uint64(t))
	case uint16:
		return uint64ToBytes(uint64(t))
	case uint32:
		return uint64ToBytes(uint64(t))
	case uint64:
		return uint64ToBytes(uint64(t))

	case float32:
		return float32ToBytes(t)
	case float64:
		return float64ToBytes(t)

	case complex128:
		return complex128ToBytes(t)
	case complex64:
		return complex128ToBytes(complex128(t))

	case bool:
		if t == true {
			return []byte("true")
		}
		return []byte("false")

	case string:
		return []byte(t)

	case []byte:
		return t

	default:
		return []byte(fmt.Sprintf("%v", val))
	}

	panic("Reached.")
}
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
}
877946
func (dsl *DestSmeList) Bytes() []byte {
	var ret []byte
	for i := range dsl.Data {
		ret = append(ret, dsl.Data[i].Bytes()...)
	}
	return ret
}
669415
func (m FileMode) Bytes() []byte {
	ret := make([]byte, 4)
	binary.LittleEndian.PutUint32(ret, uint32(m))
	return ret[:]
}
314607
func (r *MockResult) Byte(i int) byte {
	if r.Contains(i) {
		return r.Result[i].(byte)
	} else {
		return 0
	}
}
278566
func Bytes(src []byte) ([]byte, error) {
	astElem, err := ast.Parse("", src, ast.CommentsOption())
	if err != nil {
		return nil, err
	}
	return Ast(astElem)
}