NewWrapReader creates a WrapReader starting at offset off, and wrapping at offset wrapAt.
(r io.ReaderAt, off int64, wrapAt int64)
| 73 | |
| 74 | // NewWrapReader creates a WrapReader starting at offset off, and wrapping at offset wrapAt. |
| 75 | func NewWrapReader(r io.ReaderAt, off int64, wrapAt int64) *WrapReader { |
| 76 | return &WrapReader{ |
| 77 | &wrapper{ |
| 78 | doat: r.ReadAt, |
| 79 | off: (off % wrapAt), |
| 80 | wrapAt: wrapAt, |
| 81 | }, |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | // Read reads into p starting at the current offset, wrapping if it reaches the end. |
| 86 | // The current offset is shifted forward by the amount read. |