streamio

package
v0.0.0-...-c05fae0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package streamio implements utilities for working with stream data.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSeekOutOfRange indicates that a seek operation could not be fulfilled because the buffer was not big enough.
	ErrSeekOutOfRange = errors.New("out of range")
)

Functions

func CountBytes

func CountBytes(r io.Reader, counter *int64) io.Reader

CountBytes returns an io.Reader that counts all bytes read and updates the counter appropriately. counter must not be nil.

func NewBufferedReadSeeker

func NewBufferedReadSeeker(r io.Reader, size int) io.ReadSeeker

NewBufferedReadSeeker creates a new io.ReadSeeker that reads from r. Seek operations are implemented by buffering read operations from r. Seeking is only supported up to size bytes back. Advancing the reader will first return up to size bytes from the internal buffer before the next read operation is passed on to r.

Types

This section is empty.

Jump to

Keyboard shortcuts

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