func (v *View) ReadAt(p []byte, offset int64) (int, error) {
	var (
		skipped int64
		done    int64
	)
	for buf := v.data.Front(); buf != nil && done < int64(len(p)); buf = buf.Next() {
		needToSkip := int(offset - skipped)
		if l := buf.write - buf.read; l <= needToSkip {
			skipped += int64(l)
			continue
		}

		// Actually read data.
		n := copy(p[done:], buf.data[buf.read+needToSkip:buf.write])
		skipped += int64(needToSkip)
		done += int64(n)
	}
	if int(done) < len(p) {
		return int(done), io.EOF
	}
	return int(done), nil
}
// ReadAt implements io.ReaderAt.ReadAt.
ReadAt implements io.ReaderAt.ReadAt.
// ReadAt implements io . ReaderAt . ReadAt .
func (v *View) ReadAt(p []byte, offset int64) (int, error) {
	var (
		skipped int64
		done    int64
	)
	for buf := v.data.Front(); buf != nil && done < int64(len(p)); buf = buf.Next() {
		needToSkip := int(offset - skipped)
		if l := buf.write - buf.read; l <= needToSkip {
			skipped += int64(l)
			continue
		}
		n := copy(p[done:], buf.data[buf.read+needToSkip:buf.write])
		skipped += int64(needToSkip)
		done += int64(n)
	}
	if int(done) < len(p) {
		return int(done), io.EOF
	}
	return int(done), nil
}
func ( v * View ) ReadAt ( p [ ] byte , offset int64 ) ( int , error ) { var ( skipped int64 done int64 ) for buf := v . data . Front ( ) ; buf != nil && done < int64 ( len ( p ) ) ; buf = buf . Next ( ) { needToSkip := int ( offset - skipped ) if l := buf . write - buf . read ; l <= needToSkip { skipped += int64 ( l ) continue } n := copy ( p [ done : ] , buf . data [ buf . read + needToSkip : buf . write ] ) skipped += int64 ( needToSkip ) done += int64 ( n ) } if int ( done ) < len ( p ) { return int ( done ) , io . EOF } return int ( done ) , nil }
ReadAt implements io.ReaderAt.ReadAt.
ReadAt implements io . ReaderAt . ReadAt .
// Actually read data.