limitreader

package
v0.0.0-...-c4986e2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLimitReader

func NewLimitReader(r io.Reader, n int64) io.Reader

NewLimitReader returns a Reader that reads from r but stops with EOF after n bytes.

Types

type LimitedReader

type LimitedReader struct {
	R io.Reader
	N int64
}

A LimitedReader reads from R but limits the amount of data returned to just N bytes.

func (*LimitedReader) Read

func (l *LimitedReader) 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