Read reads data from the AsyncBuffer.
(p []byte)
| 14 | |
| 15 | // Read reads data from the AsyncBuffer. |
| 16 | func (r *Reader) Read(p []byte) (int, error) { |
| 17 | n, err := r.ab.ReadAt(p, r.pos) |
| 18 | if err == nil { |
| 19 | r.pos += int64(n) |
| 20 | } |
| 21 | |
| 22 | return n, err |
| 23 | } |
| 24 | |
| 25 | // Seek sets the position of the reader to the given offset and returns the new position |
| 26 | func (r *Reader) Seek(offset int64, whence int) (int64, error) { |