Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReadSeekerSize ¶
func NewReadSeekerSize(r ioctx.ReadSeeker, size int) *readSeeker
NewReadSeekerSize returns a buffered io.ReadSeeker whose buffer has at least the specified size. If r is already a readSeeker with sufficient size, returns r.
func NewReaderAtSize ¶ added in v0.0.11
NewReaderAt constructs a buffered ReaderAt. While ReaderAt allows arbitrary concurrent reads, this implementation has only one buffer (for simplicity), so reads will only be usefully buffered if reads are serial and generally contiguous (just like a plain ioctx.Reader). Concurrent reads will be "passed through" to the underlying ReaderAt, just without buffering.
Types ¶
type PeekBackReader ¶ added in v0.0.11
type PeekBackReader interface { ioctx.Reader // PeekBack returns a fixed "window" of the data that Read has already returned, ending at // the current Read position. It may be smaller at the start until enough data has been read, // but after that it's constant size. PeekBack is allowed after Read returns EOF. // The returned slice aliases the internal buffer and is invalidated by the next Read. PeekBack() []byte }
PeekBackReader is a Reader augmented with a function to "peek" backwards at the data that was already passed. Peeking does not change the current stream position (that is, PeekBack has no effect on the next Read).
func NewPeekBackReader ¶ added in v0.0.11
func NewPeekBackReader(r ioctx.Reader, peekBackSize int) PeekBackReader
NewPeekBackReader returns a PeekBackReader. It doesn't have a "forward" buffer so small PeekBackReader.Read operations cause small r.Read operations.