Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedReadSeeker ¶
type BufferedReadSeeker struct {
// contains filtered or unexported fields
}
BufferedReadSeeker provides a buffered reading interface with seeking capabilities. It wraps an io.Reader and optionally an io.Seeker, allowing for efficient reading and seeking operations, even on non-seekable underlying readers.
func NewBufferedReaderSeeker ¶
func NewBufferedReaderSeeker(r io.Reader) *BufferedReadSeeker
NewBufferedReaderSeeker creates and initializes a BufferedReadSeeker. It takes an io.Reader and checks if it supports seeking. If the reader supports seeking, it is stored in the seeker field.
func (*BufferedReadSeeker) DisableBuffering ¶
func (br *BufferedReadSeeker) DisableBuffering()
DisableBuffering stops the buffering process. This is useful after initial reads (e.g., for MIME type detection and format identification) to prevent further writes to the buffer, optimizing subsequent reads.
func (*BufferedReadSeeker) Read ¶
func (br *BufferedReadSeeker) Read(out []byte) (int, error)
Read reads len(out) bytes from the reader starting at the current index. It handles both seekable and non-seekable underlying readers efficiently.