go123: lab.nexedi.com/kirr/go123/xbufio Index | Files

package xbufio

import "lab.nexedi.com/kirr/go123/xbufio"

Package xbufio provides addons to std package bufio.

Index

Package Files

seqbuf_ioat.go xbufio.go

type Reader Uses

type Reader struct {
    *bufio.Reader
    // contains filtered or unexported fields
}

Reader is a bufio.Reader that also reports current logical position in input stream.

func NewReader Uses

func NewReader(r io.Reader) *Reader

func (*Reader) InputOffset Uses

func (r *Reader) InputOffset() int64

InputOffset returns current logical position in input stream.

type SeqReaderAt Uses

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

SeqReaderAt implements buffering for a io.ReaderAt optimized for sequential access.

Both forward, backward and interleaved forward/backward access patterns are supported

NOTE SeqReaderAt is not safe to use from multiple goroutines concurrently.

Strictly speaking this goes against io.ReaderAt interface but sequential
workloads usually mean sequential processing. It would be a pity to
add mutex for nothing.

func NewSeqReaderAt Uses

func NewSeqReaderAt(r io.ReaderAt) *SeqReaderAt

NewSeqReaderAt wraps r with SeqReaderAt with buffer of default size.

func NewSeqReaderAtSize Uses

func NewSeqReaderAtSize(r io.ReaderAt, size int) *SeqReaderAt

NewSeqReaderAtSize wraps r with SeqReaderAt with buffer of specified size.

func (*SeqReaderAt) ReadAt Uses

func (sb *SeqReaderAt) ReadAt(p []byte, pos int64) (int, error)

Package xbufio imports 3 packages (graph) and is imported by 1 packages. Updated 2019-09-19. Refresh now. Tools for package owners.