streamio

package
v3.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package streamio defines interfaces shared by other packages for streaming binary data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadUvarint

func ReadUvarint(r io.ByteReader) (uint64, error)

ReadUvarint is a convenience wrapper around binary.ReadUvarint.

func ReadVarint

func ReadVarint(r io.ByteReader) (int64, error)

ReadVarint is a convenience wrapper around binary.ReadVarint.

func UvarintSize

func UvarintSize(x uint64) int

UvarintSize returns the number of bytes needed to encode x.

func VarintSize

func VarintSize(x int64) int

VarintSize returns the number of bytes needed to encode x.

func WriteUvarint

func WriteUvarint(w io.ByteWriter, x uint64) error

WriteUvarint writes an encoded unsigned integer to w.

func WriteVarint

func WriteVarint(w io.ByteWriter, x int64) error

WriteVarint writes an encoded signed integer to w.

Types

type Reader

type Reader interface {
	io.Reader
	io.ByteReader
}

Reader is an interface that combines an io.Reader and an io.ByteReader.

type Writer

type Writer interface {
	io.Writer
	io.ByteWriter
}

Writer is an interface that combines an io.Writer and an io.ByteWriter.

var Discard Writer = discard{}

Discard is a Writer for which all calls succeed without doing anything.

Jump to

Keyboard shortcuts

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