chunkreaderat

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2021 License: Apache-2.0 Imports: 5 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ChunkReaderAt

Go Reference

A go library to cache a ReaderAt interface with chunks

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAssertion      = errors.New("assertion error")
	ErrNegativeOffset = errors.New("bytes.Reader.ReadAt: negative offset")
	ErrBufferSize     = errors.New("bufferSize can't be <= 0")
)

Functions

This section is empty.

Types

type ChunkReaderAt

type ChunkReaderAt struct {
	// contains filtered or unexported fields
}

ChunkReaderAt implement io.ReaderAt interface

func NewChunkReaderAt

func NewChunkReaderAt(rd io.ReaderAt, size, chunkSize int64, bufferSize int) (*ChunkReaderAt, error)

NewChunkReaderAt create a new ChunkReaderAt rd is a source io.ReaderAt + a Size() function mandatory for zip manipulation. chunkSize is the size of a chunk put in cache. bufferSize is the number of chunk stored in cache with an ARC eviction mecanism.

func (*ChunkReaderAt) ReadAt

func (r *ChunkReaderAt) ReadAt(b []byte, offset int64) (int, error)

func (*ChunkReaderAt) Size added in v0.2.0

func (r *ChunkReaderAt) Size() int64

Size return size of source

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址