Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SizeReaderAt ¶
An io.SectionReader implements SizeReaderAt.
func NewChunkAlignedReaderAt ¶
func NewChunkAlignedReaderAt(r SizeReaderAt, chunkSize int) (SizeReaderAt, error)
NewChunkAlignedReaderAt returns a ReaderAt wrapper that is backed by a ReaderAt r of size totalSize where the wrapper guarantees that all ReadAt calls are aligned to chunkSize boundaries and of size chunkSize (except for the final chunk, which may be shorter).
A chunk-aligned reader is good for caching, letting upper layers have any access pattern, but guarantees that the wrapped ReaderAt sees only nicely-cacheable access patterns & sizes.
Click to show internal directories.
Click to hide internal directories.