MCPcopy
hub / github.com/kopia/kopia / Copy

Function Copy

internal/sparsefile/sparsefile.go:14–19  ·  view source on GitHub ↗

Copy copies a file sparsely (omitting holes) from src to dst, while recycling shared buffers.

(dst io.WriteSeeker, src io.Reader, bufSize uint64)

Source from the content-addressed store, hash-verified

12// Copy copies a file sparsely (omitting holes) from src to dst, while recycling
13// shared buffers.
14func 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.

Callers 2

getStreamCopierFunction · 0.92
TestSparseCopyFunction · 0.70

Calls 3

GetBufferFunction · 0.92
ReleaseBufferFunction · 0.92
copyBufferFunction · 0.85

Tested by 1

TestSparseCopyFunction · 0.56