MCPcopy Index your code
hub / github.com/golang/groupcache / ReadAt

Method ReadAt

byteview.go:148–160  ·  view source on GitHub ↗

ReadAt implements io.ReaderAt on the bytes in v.

(p []byte, off int64)

Source from the content-addressed store, hash-verified

146
147// ReadAt implements io.ReaderAt on the bytes in v.
148func (v ByteView) ReadAt(p []byte, off int64) (n int, err error) {
149 if off < 0 {
150 return 0, errors.New("view: invalid offset")
151 }
152 if off >= int64(v.Len()) {
153 return 0, io.EOF
154 }
155 n = v.SliceFrom(int(off)).Copy(p)
156 if n < len(p) {
157 err = io.EOF
158 }
159 return
160}
161
162// WriteTo implements io.WriterTo on the bytes in v.
163func (v ByteView) WriteTo(w io.Writer) (n int64, err error) {

Callers

nothing calls this directly

Calls 3

LenMethod · 0.95
SliceFromMethod · 0.95
CopyMethod · 0.80

Tested by

no test coverage detected