Back to godoc.org

Package xbufio

v0.0.0 (3cf7f3f)
Latest Go to latest
Published: May 27, 2020 | License: GPL3 | Module: lab.nexedi.com/kirr/go123

Overview

Package xbufio provides addons to std package bufio.

Index

Package Files

  • seqbuf_ioat.go
  • xbufio.go

type Reader

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

func NewReader(r io.Reader) *Reader

func (*Reader) InputOffset

func (r *Reader) InputOffset() int64

InputOffset returns current logical position in input stream.

type SeqReaderAt

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

func NewSeqReaderAt(r io.ReaderAt) *SeqReaderAt

NewSeqReaderAt wraps r with SeqReaderAt with buffer of default size.

func NewSeqReaderAtSize

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

NewSeqReaderAtSize wraps r with SeqReaderAt with buffer of specified size.

func (*SeqReaderAt) ReadAt

func (sb *SeqReaderAt) ReadAt(p []byte, pos int64) (int, error)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier