func (o *GSReaderAtCloser) ReadAt(p []byte, offset int64) (n int, err error) {
	rdr, err := o.NewRangeReader(o.Context, offset, int64(len(p)))
	if err != nil {
		return 0, err
	}
	defer rdr.Close()

	// Apparently with Google Cloud Storage we get to manually handle the fact
	// that the reader will not read as much as we request, but instead may read
	// less than that. And so here, we manually check if that's the case; if so,
	// we loop until we have read at least as much as we requested.
	var nBytes int
	for {
		innerBytes, err := rdr.Read(p[nBytes:])
		nBytes += innerBytes
		if err != nil {
			return nBytes, err
		}

		if rdr.Remain() <= 0 {
			break
		}
	}

	return nBytes, nil
}
// ReadAt satisfies io.ReaderAt. Note that this is dependent upon making p a
// buffer of the desired length to be read by NewRangeReader.
ReadAt satisfies io.ReaderAt. Note that this is dependent upon making p a
buffer of the desired length to be read by NewRangeReader.
// ReadAt satisfies io . ReaderAt . Note that this is dependent upon making p a // buffer of the desired length to be read by NewRangeReader .
func (o *GSReaderAtCloser) ReadAt(p []byte, offset int64) (n int, err error) {
	rdr, err := o.NewRangeReader(o.Context, offset, int64(len(p)))
	if err != nil {
		return 0, err
	}
	defer rdr.Close()
	var nBytes int
	for {
		innerBytes, err := rdr.Read(p[nBytes:])
		nBytes += innerBytes
		if err != nil {
			return nBytes, err
		}
		if rdr.Remain() <= 0 {
			break
		}
	}
	return nBytes, nil
}
func ( o * GSReaderAtCloser ) ReadAt ( p [ ] byte , offset int64 ) ( n int , err error ) { rdr , err := o . NewRangeReader ( o . Context , offset , int64 ( len ( p ) ) ) if err != nil { return 0 , err } defer rdr . Close ( ) var nBytes int for { innerBytes , err := rdr . Read ( p [ nBytes : ] ) nBytes += innerBytes if err != nil { return nBytes , err } if rdr . Remain ( ) <= 0 { break } } return nBytes , nil }
ReadAt satisfies io.ReaderAt.
ReadAt satisfies io . ReaderAt .
// Apparently with Google Cloud Storage we get to manually handle the fact // that the reader will not read as much as we request, but instead may read // less than that. And so here, we manually check if that's the case; if so, // we loop until we have read at least as much as we requested.