func (a *Attachment) Bytes() ([]byte, error) {
	if buf, ok := a.ReadCloser.(*bufCloser); ok {
		// Simple optimization
		return buf.Bytes(), nil
	}
	buf := &bytes.Buffer{}
	if _, err := io.Copy(buf, a); err != nil {
		return nil, err
	}
	a.ReadCloser = &bufCloser{buf}
	return buf.Bytes(), nil
}
// Bytes returns the attachment's body as a byte slice.
Bytes returns the attachment's body as a byte slice.
// Bytes returns the attachment ' s body as a byte slice .
func (a *Attachment) Bytes() ([]byte, error) {
	if buf, ok := a.ReadCloser.(*bufCloser); ok {
		return buf.Bytes(), nil
	}
	buf := &bytes.Buffer{}
	if _, err := io.Copy(buf, a); err != nil {
		return nil, err
	}
	a.ReadCloser = &bufCloser{buf}
	return buf.Bytes(), nil
}
func ( a * Attachment ) Bytes ( ) ( [ ] byte , error ) { if buf , ok := a . ReadCloser . ( * bufCloser ) ; ok { return buf . Bytes ( ) , nil } buf := & bytes . Buffer { } if _ , err := io . Copy ( buf , a ) ; err != nil { return nil , err } a . ReadCloser = & bufCloser { buf } return buf . Bytes ( ) , nil }
Bytes returns the attachment's body as a byte slice.
Bytes returns the attachment ' s body as a byte slice .
// Simple optimization