// Bytes returns the bytes
7016
func (m *Message) Bytes() []byte {
	if m.FPort == 0 && len(m.Payload) > 0 {
		m.FPort = 1
	}
	macPayload := &lorawan.MACPayload{}
	macPayload.FHDR = lorawan.FHDR{
		DevAddr: lorawan.DevAddr(m.devAddr),
		FCnt:    uint32(m.FCnt),
		FCtrl: lorawan.FCtrl{
			ACK: m.ack,
		},
	}
	macPayload.FPort = pointer.Uint8(uint8(m.FPort))
	if len(m.Payload) > 0 {
		macPayload.FRMPayload = []lorawan.Payload{&lorawan.DataPayload{Bytes: m.Payload}}
	}
	phyPayload := &lorawan.PHYPayload{}
	phyPayload.MHDR = lorawan.MHDR{
		MType: lorawan.UnconfirmedDataUp,
		Major: lorawan.LoRaWANR1,
	}
	if m.confirmed {
		phyPayload.MHDR.MType = lorawan.ConfirmedDataUp
	}
	phyPayload.MACPayload = macPayload
	phyPayload.EncryptFRMPayload(lorawan.AES128Key(m.appSKey))
	phyPayload.SetMIC(lorawan.AES128Key(m.nwkSKey))
	uplinkBytes, _ := phyPayload.MarshalBinary()
	return uplinkBytes
}
31460
func (b *Box) Bytes(name string) ([]byte, error) {
	file, err := b.Open(name)
	if err != nil {
		return nil, err
	}
	defer file.Close()

	content, err := ioutil.ReadAll(file)
	if err != nil {
		return nil, err
	}

	return content, nil
}
283146
func (m *Message) Bytes() io.Reader {
	var b = new(bytes.Buffer)

	for k, vs := range m.Content.Headers {
		for _, v := range vs {
			b.WriteString(k + ": " + v + "\r\n")
		}
	}

	b.WriteString("\r\n")
	b.WriteString(m.Content.Body)

	return b
}
690073
func (a *Array) Bytes(val []byte) *Array {
	a.buf = enc.AppendBytes(enc.AppendArrayDelim(a.buf), val)
	return a
}
70396
func Bytes(length int) []byte {
	out := make([]byte, length)
	if _, err := io.ReadFull(rand.Reader, out); err != nil {
		panic(err)
	}
	return out
}
443432
func (m *Message) Bytes() ([]byte, error) {
	buffer := &bytes.Buffer{}
	_, err := m.WriteTo(buffer)
	return buffer.Bytes(), err
}
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
}
753924
func (a *AdvPacket) Bytes() [31]byte {
	b := [31]byte{}
	copy(b[:], a.b)
	return b
}
613768
func (def *Synthdef) Bytes() ([]byte, error) {
	arr := []byte{}
	buf := bytes.NewBuffer(arr)
	err := def.Write(buf)
	if err != nil {
		return arr, err
	}
	return buf.Bytes(), nil
}
1272884
func (v *id) Bytes() []byte {
	if v.data == nil {
		return nil
	}
	return v.data.Bytes()
}
122119
func (h *HTTPBin) Bytes(w http.ResponseWriter, r *http.Request) {
	handleBytes(w, r, false)
}
1089667
func (p Ping) Bytes() []byte {
	data, _ := json2.Marshal(p)
	return data
}
225095
func (u UUID) Bytes() ([]byte, error) {
	id, err := uuid.FromString(string(u))
	if err != nil {
		return nil, errors.Wrap(err, "invalid uuid string")
	}
	return id.Bytes(), nil
}
581568
func (p *Prefix) Bytes() []byte {
	buffer := new(bytes.Buffer)
	p.writeTo(buffer)
	return buffer.Bytes()
}
669415
func (m FileMode) Bytes() []byte {
	ret := make([]byte, 4)
	binary.LittleEndian.PutUint32(ret, uint32(m))
	return ret[:]
}
172815
func (p *parserMixin) Bytes() (target *units.Base2Bytes) {
	target = new(units.Base2Bytes)
	p.BytesVar(target)
	return
}
840568
func Bytes(s string) []byte {
	if !Enable {
		return []byte(s)
	}
	pstring := (*reflect.StringHeader)(unsafe.Pointer(&s))
	return BytesFromPtr(pstring.Data, pstring.Len)
}