MCPcopy Create free account
hub / github.com/djherbis/buffer / ReadAt

Method ReadAt

wrapio/limitwrap.go:70–74  ·  view source on GitHub ↗

ReadAt reads from the current offset+off into p, wrapping at Cap()

(p []byte, off int64)

Source from the content-addressed store, hash-verified

68
69// ReadAt reads from the current offset+off into p, wrapping at Cap()
70func (wpr *Wrapper) ReadAt(p []byte, off int64) (n int, err error) {
71 wrap := NewWrapReader(wpr.rwa, wpr.O+off, wpr.N)
72 r := io.LimitReader(wrap, wpr.L-off)
73 return r.Read(p)
74}
75
76// Write writes p to the end of the Wrapper (at Len()), wrapping at Cap()
77func (wpr *Wrapper) Write(p []byte) (n int, err error) {

Callers 2

TestWrapperFunction · 0.95
ReadMethod · 0.95

Calls 2

NewWrapReaderFunction · 0.85
ReadMethod · 0.45

Tested by 1

TestWrapperFunction · 0.76