varint

package
v0.0.0-...-add2d34 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: GPL-3.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOutOfRange = errors.New("out of range")
)

Functions

func ReadByte

func ReadByte(r io.Reader) (byte, error)

ReadBytes reads a single byte from the given io.Reader.

func ReadFrom

func ReadFrom(r io.Reader) (int64, int64, error)

ReadFrom reads a varint encoded from the given io.Reader.

On success, the function returns the varint as a int64, the number of bytes consumed, and nil.

func WriteTo

func WriteTo(w io.Writer, value int64) (int64, error)

WriteTo writes the given value to the given io.Writer as a varint encoded byte array.

On success, the function returns the number of bytes written to the writer, and nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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