binaryio

package
v1.29.4 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinimumReader

type MinimumReader struct {
	R                      io.Reader
	MinNumberOfBytesToRead int64 // Min number of bytes we need to read from the reader
}

MinimumReader is the implementation for MinReader.

func MinReader

func MinReader(r io.Reader, minNumberOfBytesToRead int64) *MinimumReader

MinReader reads from R but ensures there is at least N bytes read from the reader. The reader should call Close() when they are done reading. Closing the MinReader will read and discard any unread bytes up to MinNumberOfBytesToRead. CLosing the MinReader does NOT close the underlying reader. The underlying implementation is a MinimumReader, which implements ReaderCloser.

func (*MinimumReader) Close

func (r *MinimumReader) Close() error

Close does not close the underlying reader, only the MinimumReader

func (*MinimumReader) Read

func (r *MinimumReader) 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