Copy copies a file sparsely (omitting holes) from src to dst, while recycling shared buffers.
(dst io.WriteSeeker, src io.Reader, bufSize uint64)
| 12 | // Copy copies a file sparsely (omitting holes) from src to dst, while recycling |
| 13 | // shared buffers. |
| 14 | func Copy(dst io.WriteSeeker, src io.Reader, bufSize uint64) (int64, error) { |
| 15 | buf := iocopy.GetBuffer() |
| 16 | defer iocopy.ReleaseBuffer(buf) |
| 17 | |
| 18 | return copyBuffer(dst, src, buf[0:bufSize]) |
| 19 | } |
| 20 | |
| 21 | // Copy copies bits from src to dst, seeking past blocks of zero bits in src. These |
| 22 | // blocks are omitted, creating a file with holes in dst. |