MCPcopy Create free account
hub / github.com/git-lfs/git-lfs / Read

Method Read

tools/copycallback.go:36–47  ·  view source on GitHub ↗

Read wraps the underlying Reader's "Read" method. It also captures the number of bytes read, and calls the callback.

(p []byte)

Source from the content-addressed store, hash-verified

34// Read wraps the underlying Reader's "Read" method. It also captures the number
35// of bytes read, and calls the callback.
36func (r *BodyWithCallback) Read(p []byte) (int, error) {
37 n, err := r.ReadSeekCloser.Read(p)
38
39 if n > 0 {
40 r.readSize += int64(n)
41
42 if (err == nil || err == io.EOF) && r.c != nil {
43 err = r.c(r.totalSize, r.readSize, n)
44 }
45 }
46 return n, err
47}
48
49// Seek wraps the underlying Seeker's "Seek" method, updating the number of
50// bytes that have been consumed by this reader.

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected