// ToBytes returns an OSC representation of the given string.
// This means that the returned byte slice is padded with null bytes
// so that it's length is a multiple of 4.
181048
func ToBytes(s string) []byte {
	if len(s) == 0 {
		return []byte{}
	}
	return Pad(append([]byte(s), 0))
}
1244981
func (f *Filter) PBytes() ([]byte, error) {
	filterData := make([]byte, len(f.filterData)+1)
	filterData[0] = f.p
	copy(filterData[1:], f.filterData)
	return filterData, nil
}
687251
func StringToBytes(s string) []byte {
	return *(*[]byte)(unsafe.Pointer(
		&struct {
			string
			Cap int
		}{s, len(s)},
	))
}
912778
func (r *RenderTemplateResult) ToBytes() (b *bytes.Buffer, err error) {
	defer func() {
		if rerr := recover(); rerr != nil {
			resultsLog.Error("ApplyBytes: panic recovery", "recover-error", rerr)
			err = fmt.Errorf("Template Execution Panic in %s:\n%s", r.Template.Name(), rerr)
		}
	}()
	b = &bytes.Buffer{}
	if err = r.renderOutput(b); err == nil {
		if Config.BoolDefault("results.trim.html", false) {
			b = r.compressHtml(b)
		}
	}
	return
}
1196396
func StringToBytes(s string) []byte {
	strstruct := runtimer.StringStructOf(&s)
	return *(*[]byte)(unsafe.Pointer(&runtimer.SliceType2{
		Array: strstruct.Str,
		Len:   strstruct.Len,
		Cap:   strstruct.Len,
	}))
}
496618
func (s *Document) SetBytes(v []byte) *Document {
	s.Bytes = v
	return s
}
211783
func toBytes(r *orcapb.LoadReport) []byte {
	if r == nil {
		return nil
	}

	b, err := proto.Marshal(r)
	if err != nil {
		grpclog.Warningf("orca: failed to marshal load report: %v", err)
		return nil
	}
	return b
}
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
}
67351
func (pub *PublicKey) ToBytesUncompressed() (b []byte) {
	/* See Certicom SEC1 2.3.3, pg. 10 */

	x := pub.X.Bytes()
	y := pub.Y.Bytes()

	/* Pad X and Y coordinate bytes to 32-bytes */
	padded_x := append(bytes.Repeat([]byte{0x00}, 32-len(x)), x...)
	padded_y := append(bytes.Repeat([]byte{0x00}, 32-len(y)), y...)

	/* Add prefix 0x04 for uncompressed coordinates */
	return append([]byte{0x04}, append(padded_x, padded_y...)...)
}
221954
func Bytes(m *rfc5424.Message) []byte {
	msg := m.Bytes()
	return bytes.Join([][]byte{[]byte(strconv.Itoa(len(msg))), msg}, []byte{' '})
}
1176019
func (id ID) ToBytes() []byte {
	b := make([]byte, EncodedLength)
	if err := id.Write(b); err != nil {
		log.Errorf("Unable to write as 16-bytes representation: %v", err)
	}
	return b
}
1014149
func (this *ApnsBatchRequest) ToByte() ([]byte, error) {
	data, err := json.Marshal(this)
	if err != nil {
		return nil, err
	}

	return data, nil
}
239855
func (p *Buffer) EncodeStringBytes(s string) error {
	p.EncodeVarint(uint64(len(s)))
	p.buf = append(p.buf, s...)
	return nil
}
1360972
func (e *StringDecoder) SetBytes(b []byte) error {
	// First byte stores the encoding type, only have snappy format
	// currently so ignore for now.
	var data []byte
	if len(b) > 0 {
		var err error
		data, err = snappy.Decode(nil, b[1:])
		if err != nil {
			return fmt.Errorf("failed to decode string block: %v", err.Error())
		}
	}

	e.b = data
	e.l = 0
	e.i = 0
	e.err = nil

	return nil
}
123078
func EncodeBytes(data []byte) string {
	mt := http.DetectContentType(data)
	// http.DetectContentType may add spurious spaces between ; and a parameter.
	// The canonical way is to not have them.
	cleanedMt := strings.Replace(mt, "; ", ";", -1)

	return New(data, cleanedMt).String()
}
1319350
func MD5Bytes(str string) []byte {
	m := md5.New()
	m.Write([]byte(str))
	return m.Sum(nil)
}
1054833
func (d Data) GetBytes(key string) []byte {
	return []byte(d.Get(key))
}