// SetContent encodes and (if Compressed=true) compresses c and sets b's content
SetContent encodes and (if Compressed=true) compresses c and sets b's content
// SetContent encodes and ( if Compressed = true ) compresses c and sets b ' s content
func (b *Binary) SetContent(c []byte) error {
	buff := &bytes.Buffer{}
	writer := base64.NewEncoder(base64.StdEncoding, buff)
	if b.Compressed.Bool {
		writer = gzip.NewWriter(writer)
	}
	_, err := writer.Write(c)
	if err != nil {
		return err
	}
	if err := writer.Close(); err != nil {
		return err
	}
	b.Content = buff.Bytes()
	return nil
}
func ( b * Binary ) SetContent ( c [ ] byte ) error { buff := & bytes . Buffer { } writer := base64 . NewEncoder ( base64 . StdEncoding , buff ) if b . Compressed . Bool { writer = gzip . NewWriter ( writer ) } _ , err := writer . Write ( c ) if err != nil { return err } if err := writer . Close ( ) ; err != nil { return err } b . Content = buff . Bytes ( ) return nil }
SetContent encodes and (if Compressed=true) compresses c and sets b's content
SetContent encodes and ( if Compressed = true ) compresses c and sets b ' s content