FromBase64 deserializes a bitmap from Base64
(str string)
| 31 | |
| 32 | // FromBase64 deserializes a bitmap from Base64 |
| 33 | func (rb *Bitmap) FromBase64(str string) (int64, error) { |
| 34 | data, err := base64.StdEncoding.DecodeString(str) |
| 35 | if err != nil { |
| 36 | return 0, err |
| 37 | } |
| 38 | buf := bytes.NewBuffer(data) |
| 39 | |
| 40 | return rb.ReadFrom(buf) |
| 41 | } |
| 42 | |
| 43 | // ToBytes returns an array of bytes corresponding to what is written |
| 44 | // when calling WriteTo |