// Bytes produces a raw binary format of the CID.
184494
func (c CidStruct) Bytes() []byte {
	switch c.version {
	case 0:
		return []byte(c.hash)
	case 1:
		// two 8 bytes (max) numbers plus hash
		buf := make([]byte, 2*binary.MaxVarintLen64+len(c.hash))
		n := binary.PutUvarint(buf, c.version)
		n += binary.PutUvarint(buf[n:], c.codec)
		cn := copy(buf[n:], c.hash)
		if cn != len(c.hash) {
			panic("copy hash length is inconsistent")
		}
		return buf[:n+len(c.hash)]
	default:
		panic("not possible to reach this point")
	}
}
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
}
77420
func (cb *CountBytes) Bytes() int64 {
	cb.mu.Lock()
	defer cb.mu.Unlock()
	return cb.bytes
}
1037082
func (b *Buffer) Bytes() []byte {
	if b == nil || b.C_gss_buffer_t == nil || b.C_gss_buffer_t.length == 0 {
		return make([]byte, 0)
	}
	return C.GoBytes(b.C_gss_buffer_t.value, C.int(b.C_gss_buffer_t.length))
}
1044731
func (b Blob) Bytes() []byte {
	return Pad(bytes.Join([][]byte{
		Int(len(b)).Bytes(),
		[]byte(b),
	}, []byte{}))
}
621125
func (r *Rx) Bytes() (tx, rx []byte) {
	return r.tx.Bytes(), r.rx.Bytes()
}
79414
func (b *Buffer) Bytes() []byte {
	if b.Len() == 0 {
		return nil
	}

	m := make([]byte, 0, b.Len())
	idx := b.fidx
	for cur := b.first; cur != nil; cur = cur.next {
		m = append(m, cur.Bytes()[idx:]...)
		idx = 0
	}
	return m
}
1079594
func (ae *AttributeEncoder) Bytes(typ uint16, b []byte) {
	if ae.err != nil {
		return
	}

	ae.attrs = append(ae.attrs, Attribute{
		Type: typ,
		Data: b,
	})
}
1157780
func Bytes(l int, dev string) ([]byte, error) {
	if l <= 0 {
		return nil, e.New(ErrInvalidLength)
	}
	switch dev {
	case "go":
		b := make([]byte, l)
		for i := 0; i < l; i++ {
			b[i] = byte(rand.Intn(255))
		}
		return b, nil
	case "go-crypto":
		b := make([]byte, l)
		n, err := io.ReadFull(crypto.Reader, b)
		if n != len(b) || err != nil {
			return nil, e.Forward(err)
		}
		return b, nil
	default:
		f, err := os.Open(dev)
		if err != nil {
			return nil, e.Forward(err)
		}
		b := make([]byte, l)
		f.Read(b)
		f.Close()
		return b, nil
	}
	panic("don't get here")
}
296453
func (m *OutMessage) Bytes() []byte {
	l := m.Len()
	sh := reflect.SliceHeader{
		Data: uintptr(unsafe.Pointer(&m.header)),
		Len:  l,
		Cap:  l,
	}

	return *(*[]byte)(unsafe.Pointer(&sh))
}
64863
func (e *StringEncoder) Bytes() ([]byte, error) {
	// Compress the currently appended bytes using snappy and prefix with
	// a 1 byte header for future extension
	data := snappy.Encode(nil, e.bytes)
	return append([]byte{stringCompressedSnappy << 4}, data...), nil
}
748586
func (spec DiskSpec) Bytes() []byte {
	b, err := json.Marshal(spec)
	if err != nil {
		// should not happen
		panic(err)
	}
	return bytes.TrimSpace(b)
}
159204
func (ad *AttributeDecoder) Bytes() []byte {
	src := ad.data()
	dest := make([]byte, len(src))
	copy(dest, src)
	return dest
}
1067297
func (s *FloatEncoder) Bytes() ([]byte, error) {
	return s.buf.Bytes(), s.err
}
820547
func (m *Message) Bytes() ([]byte, error) {
	if b, ok := m.val.([]byte); ok {
		return b, nil
	}
	return nil, badType
}
180626
func Bytes(w http.ResponseWriter, code int, bs []byte) {
	w.WriteHeader(code)
	if code == 204 {
		return
	}
	w.Write(bs)
}
888748
func (k *aesPrivateKey) Bytes() (raw []byte, err error) {
	if k.exportable {
		return k.privKey, nil
	}

	return nil, errors.New("Not supported.")
}