MCPcopy
hub / github.com/rclone/rclone / getChunk

Method getChunk

backend/mega/mega.go:1065–1080  ·  view source on GitHub ↗

get the next chunk

(ctx context.Context)

Source from the content-addressed store, hash-verified

1063
1064// get the next chunk
1065func (oo *openObject) getChunk(ctx context.Context) (err error) {
1066 if oo.id >= oo.d.Chunks() {
1067 return io.EOF
1068 }
1069 var chunk []byte
1070 err = oo.o.fs.pacer.Call(func() (bool, error) {
1071 chunk, err = oo.d.DownloadChunk(oo.id)
1072 return shouldRetry(ctx, err)
1073 })
1074 if err != nil {
1075 return err
1076 }
1077 oo.id++
1078 oo.chunk = chunk
1079 return nil
1080}
1081
1082// Read reads up to len(p) bytes into p.
1083func (oo *openObject) Read(p []byte) (n int, err error) {

Callers 1

ReadMethod · 0.95

Calls 2

shouldRetryFunction · 0.70
CallMethod · 0.45

Tested by

no test coverage detected