MCPcopy
hub / github.com/NVIDIA/aistore / WriteTo

Method WriteTo

memsys/iosgl.go:130–149  ·  view source on GitHub ↗

NOTE: not advancing roff here - see usage

(dst io.Writer)

Source from the content-addressed store, hash-verified

128
129// NOTE: not advancing roff here - see usage
130func (z *SGL) WriteTo(dst io.Writer) (n int64, err error) {
131 var (
132 n0 int
133 toWrite = z.woff
134 )
135 for _, buf := range z.sgl {
136 l := cos.MinI64(toWrite, int64(len(buf)))
137 if l == 0 {
138 break
139 }
140 n0, err = dst.Write(buf[:l])
141 n += int64(n0)
142 toWrite -= l
143
144 if err != nil {
145 return
146 }
147 }
148 return
149}
150
151func (z *SGL) Write(p []byte) (n int, err error) {
152 wlen := len(p)

Callers 5

copyObjS3Method · 0.95
bckNamesToS3Method · 0.95
bckListS3Method · 0.95
getBckVersioningS3Method · 0.95
SaveFunction · 0.80

Calls 2

MinI64Function · 0.92
WriteMethod · 0.45

Tested by

no test coverage detected