linear

package
v0.0.0-...-46dc427 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package linear implements ClonedBuffer and SharedBuffer.

Index

Constants

View Source
const BlockSize = 131072

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

func NewBuffer

func NewBuffer(linear []byte) (b *Buffer)

func (*Buffer) BlockPopulated

func (b *Buffer) BlockPopulated(index int)

BlockPopulated marks a 128 kB block as available for reading.

func (*Buffer) BlocksPopulated

func (b *Buffer) BlocksPopulated(index, count int)

BlocksPopulated marks adjacent 128 kB blocks as available for reading.

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

func (*Buffer) Close

func (b *Buffer) Close() (err error)

func (*Buffer) Closed

func (b *Buffer) Closed() <-chan struct{}

func (*Buffer) Len

func (b *Buffer) Len() int

func (*Buffer) PopulationFinished

func (b *Buffer) PopulationFinished()

PopulationFinished indicates that no more blocks will become available, either because all have been populated, or due to cancellation or error.

func (*Buffer) ReadAt

func (b *Buffer) ReadAt(target []byte, sourceOffset int64) (n int, err error)

func (*Buffer) WriteAt

func (b *Buffer) WriteAt(source []byte, targetOffset int64) (n int, err error)

Jump to

Keyboard shortcuts

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