xbufio

package
v0.0.0-...-8299741 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: GPL-3.0 Imports: 4 Imported by: 2

Documentation

Overview

Package xbufio provides addons to std package bufio.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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)

Jump to

Keyboard shortcuts

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