ioz

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package ioz provides various utilities for working with input/output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustReadAll

func MustReadAll(r io.Reader) []byte

MustReadAll is like io.ReadAll, but panics on error.

func MustReadAllAndClose

func MustReadAllAndClose(r io.ReadCloser) []byte

MustReadAllAndClose is like MustReadAll but also always closes the ReadCloser.

func MustReadAllAndCloseString

func MustReadAllAndCloseString(r io.ReadCloser) string

MustReadAllAndCloseString is like MustReadAllAndClose, but returns a string.

func MustReadAllString

func MustReadAllString(r io.Reader) string

MustReadAllString is like MustReadAll, but returns a string.

Types

type CountingReader

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

CountingReader implements a io.Reader that counts bytes.

func NewCountingReader

func NewCountingReader(r io.Reader) *CountingReader

NewCountingReader initializes a new *CountingReader.

func (*CountingReader) Count

func (c *CountingReader) Count() int64

Count returns the number of bytes read.

func (*CountingReader) Read

func (c *CountingReader) Read(p []byte) (int, error)

Read implements the io.Reader interface.

Jump to

Keyboard shortcuts

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