// Add appends binary data to the slice
Add appends binary data to the slice
// Add appends binary data to the slice
func (bs *Binaries) Add(c []byte) *Binary {
	binary := Binary{
		Compressed: w.NewBoolWrapper(true),
	}
	if len(*bs) == 0 {
		binary.ID = 0
	} else {
		binary.ID = (*bs)[len(*bs)-1].ID + 1
	}
	binary.SetContent(c)
	*bs = append(*bs, binary)
	return &(*bs)[len(*bs)-1]
}
func ( bs * Binaries ) Add ( c [ ] byte ) * Binary { binary := Binary { Compressed : w . NewBoolWrapper ( true ) , } if len ( * bs ) == 0 { binary . ID = 0 } else { binary . ID = ( * bs ) [ len ( * bs ) - 1 ] . ID + 1 } binary . SetContent ( c ) * bs = append ( * bs , binary ) return & ( * bs ) [ len ( * bs ) - 1 ] }
Add appends binary data to the slice
Add appends binary data to the slice