//--------------------------------------------------------------------------------------------------
// Bytes - Converts the contained object back to a JSON []byte blob.
768908
func (g *Container) Bytes() []byte {
	if g.Data() != nil {
		if bytes, err := json.Marshal(g.object); err == nil {
			return bytes
		}
	}
	return []byte("{}")
}
596074
func (e *ErrorV1) Bytes() []byte {
	if bs, err := json.MarshalIndent(e, "", "  "); err == nil {
		return bs
	}
	return nil
}
221954
func Bytes(m *rfc5424.Message) []byte {
	msg := m.Bytes()
	return bytes.Join([][]byte{[]byte(strconv.Itoa(len(msg))), msg}, []byte{' '})
}
30292
func Bytes(n int) []byte {
	b := make([]byte, n)
	_, err := rand.Read(b)
	if err != nil {
		panic(err)
	}
	return b
}
597208
func (this *Context) Bytes() []byte {
    if len(this.List) != 0 {
        return this.List[0]
    }

    return nil
}
820547
func (m *Message) Bytes() ([]byte, error) {
	if b, ok := m.val.([]byte); ok {
		return b, nil
	}
	return nil, badType
}
77420
func (cb *CountBytes) Bytes() int64 {
	cb.mu.Lock()
	defer cb.mu.Unlock()
	return cb.bytes
}
924893
func (t *Tx) Bytes() (tx, rx []byte) {
	return t.tx.Bytes(), t.rx.Bytes()
}
628348
func (ds *DestSme) Bytes() []byte {
	var ret []byte
	ret = append(ret, ds.Flag.Bytes()...)
	ret = append(ret, ds.Ton.Bytes()...)
	ret = append(ret, ds.Npi.Bytes()...)
	ret = append(ret, ds.DestAddr.Bytes()...)
	return ret
}
349354
func (w *singleWriterReader) Bytes() []byte {
	w.mu.Lock()
	defer w.mu.Unlock()

	return append(w.b2.Bytes(), w.b.Bytes()...)
}
251368
func (r *Reply) Bytes() ([]byte, error) {
	if r.Type == ErrorReply {
		return nil, r.Err
	}
	if !(r.Type == StatusReply || r.Type == BulkReply) {
		return nil, errors.New("string value is not available for this reply type")
	}

	return r.buf, nil
}
254195
func Bytes(reply interface{}, err error) ([][]byte, error) {
	if err != nil {
		return nil, err
	}
	switch reply := reply.(type) {
	case []interface{}:
		result := make([][]byte, len(reply))
		for i, v := range reply {
			if v == nil {
				continue
			}

			p, ok := v.([]byte)
			if !ok {
				return nil, fmt.Errorf("kvstore: unexpected type for Bytes, got type %T", v)
			}
			result[i] = p
		}
		return result, nil
	case nil:
		return nil, redis.ErrNil
	case redis.Error:
		return nil, reply
	}
	return nil, fmt.Errorf("kvstore: unexpected type for Bytes, got type %T", reply)
}
702210
func (f *Filter) Bytes() ([]byte, error) {
	filterData := make([]byte, len(f.filterData))
	copy(filterData, f.filterData)
	return filterData, nil
}
877514
func Bytes(n int) []byte {
	b := make([]byte, n)
	Read(b)
	return b
}
579145
func (s *CatIndicesService) Bytes(bytes string) *CatIndicesService {
	s.bytes = bytes
	return s
}
1247647
func (b *Batch) Bytes() (*bytes.Buffer, error) {
	buf := new(bytes.Buffer)
	enc := json.NewEncoder(buf)

	op := IndexOp{
		Index: Index{
			Index: b.Index,
			Type:  b.Type,
		},
	}

	for _, doc := range b.Docs {
		if err := enc.Encode(op); err != nil {
			return nil, err
		}

		if err := enc.Encode(doc); err != nil {
			return nil, err
		}
	}

	return buf, 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()
}