Struct: s3manager.BufferedReadSeeker
Overview
BufferedReadSeeker is buffered io.ReadSeeker
Implemented Interfaces
s3crypto.Cipher, s3manager.ReadSeekerWriteTo, s3manager.WriterReadFrom
Constructor Functions collapse
-
func NewBufferedReadSeeker(r io.ReadSeeker, b []byte) *BufferedReadSeeker
NewBufferedReadSeeker returns a new BufferedReadSeeker if len(b) == 0 then the buffer will be initialized to 64 KiB.
Method Summary collapse
-
func (b *BufferedReadSeeker) Read(p []byte) (n int, err error)
Read will read up len(p) bytes into p and will return the number of bytes read and any error that occurred.
-
func (b *BufferedReadSeeker) ReadAt(p []byte, off int64) (int, error)
ReadAt will read up to len(p) bytes at the given file offset.
-
func (b *BufferedReadSeeker) Seek(offset int64, whence int) (int64, error)
Seek will position then underlying io.ReadSeeker to the given offset and will clear the buffer.
Function Details
func NewBufferedReadSeeker(r io.ReadSeeker, b []byte) *BufferedReadSeeker
NewBufferedReadSeeker returns a new BufferedReadSeeker if len(b) == 0 then the buffer will be initialized to 64 KiB.
17 18 19 20 21 22 |
// File 'service/s3/s3manager/buffered_read_seeker.go', line 17
|
Method Details
func (b *BufferedReadSeeker) Read(p []byte) (n int, err error)
Read will read up len(p) bytes into p and will return the number of bytes read and any error that occurred. If the len(p) > the buffer size then a single read request will be issued to the underlying io.ReadSeeker for len(p) bytes. A Read request will at most perform a single Read to the underlying io.ReadSeeker, and may return < len(p) if serviced from the buffer.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
// File 'service/s3/s3manager/buffered_read_seeker.go', line 35
|
func (b *BufferedReadSeeker) ReadAt(p []byte, off int64) (int, error)
ReadAt will read up to len(p) bytes at the given file offset. This will result in the buffer being cleared.
73 74 75 76 77 78 79 80 |
// File 'service/s3/s3manager/buffered_read_seeker.go', line 73
|
func (b *BufferedReadSeeker) Seek(offset int64, whence int) (int64, error)
Seek will position then underlying io.ReadSeeker to the given offset and will clear the buffer.
63 64 65 66 67 68 69 |
// File 'service/s3/s3manager/buffered_read_seeker.go', line 63
|