Read reads from the current offset into p, wrapping at Cap()
(p []byte)
| 59 | |
| 60 | // Read reads from the current offset into p, wrapping at Cap() |
| 61 | func (wpr *Wrapper) Read(p []byte) (n int, err error) { |
| 62 | n, err = wpr.ReadAt(p, 0) |
| 63 | wpr.L -= int64(n) |
| 64 | wpr.O += int64(n) |
| 65 | wpr.O %= wpr.N |
| 66 | return n, err |
| 67 | } |
| 68 | |
| 69 | // ReadAt reads from the current offset+off into p, wrapping at Cap() |
| 70 | func (wpr *Wrapper) ReadAt(p []byte, off int64) (n int, err error) { |