func()

in lambda/internal/tarfile/s3file.go [142:159]


func (f *S3File) ReadAt(b []byte, off int64) (n int, err error) {
	logrus.Debugf("S3File: ReadAt %d bytes %d offset", len(b), off)

	if off < 0 {
		return 0, errors.New("S3File: negative offset")
	}
	if off >= f.size {
		return 0, io.EOF
	}
	if f.rcache == nil {
		return 0, errors.New("S3File: rcache is nil, did you close the file?")
	}
	buf, err := f.rcache.Read(off, off+int64(len(b)), f.onCacheMiss)
	if err != nil {
		return 0, err
	}
	return copy(b, buf), nil
}