mirror of
https://github.com/restic/restic.git
synced 2024-12-28 02:38:33 +00:00
16 lines
318 B
Go
16 lines
318 B
Go
package s3
|
|
|
|
import "io"
|
|
|
|
// ContinuousReader implements an io.Reader on top of an io.ReaderAt, advancing
|
|
// an offset.
|
|
type ContinuousReader struct {
|
|
R io.ReaderAt
|
|
Offset int64
|
|
}
|
|
|
|
func (c *ContinuousReader) Read(p []byte) (int, error) {
|
|
n, err := c.R.ReadAt(p, c.Offset)
|
|
c.Offset += int64(n)
|
|
return n, err
|
|
}
|