countingreader

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader counts the bytes read through it.

func New

func New(r io.Reader) *Reader

NewReader makes a new Reader that counts the bytes read through it.

func NewLimited

func NewLimited(r io.Reader, maxBytes int64) *Reader

NewLimited makes a new Reader that counts the bytes read through it.

When maxBytes bytes are read, the next read will return io.EOF even though the underlying reader has more data.

func (*Reader) N

func (r *Reader) N() int64

N gets the number of bytes that have been read so far.

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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