MCPcopy
hub / github.com/AlistGo/alist / Read

Method Read

drivers/ftps/util.go:73–80  ·  view source on GitHub ↗
(buf []byte)

Source from the content-addressed store, hash-verified

71}
72
73func (r *FileReader) Read(buf []byte) (n int, err error) {
74 r.mu.Lock()
75 defer r.mu.Unlock()
76 off := r.offset.Load()
77 n, err = r.readAtLocked(buf, off)
78 r.offset.Add(int64(n))
79 return
80}
81
82func (r *FileReader) ReadAt(buf []byte, off int64) (n int, err error) {
83 if off < 0 {

Callers 1

readAtLockedMethod · 0.45

Calls 4

readAtLockedMethod · 0.95
LoadMethod · 0.80
UnlockMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected