Bytes merges all ordered parts into memory.
()
| 245 | |
| 246 | // Bytes merges all ordered parts into memory. |
| 247 | func (s *FileBodySource) Bytes() ([]byte, error) { |
| 248 | var buf bytes.Buffer |
| 249 | if errWrite := s.WriteTo(&buf); errWrite != nil { |
| 250 | return nil, errWrite |
| 251 | } |
| 252 | return buf.Bytes(), nil |
| 253 | } |
| 254 | |
| 255 | // Cleanup removes all temp detail parts and their directory. |
| 256 | func (s *FileBodySource) Cleanup() error { |