quicvarint

package
v3.33.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Len

func Len(i uint64) uint64

Len determines the number of bytes that will be needed to write the number i.

func Read

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

Read reads a number in the QUIC varint format from r.

func Write

func Write(w Writer, i uint64)

Write writes i in the QUIC varint format to w.

Types

type Reader

type Reader interface {
	io.ByteReader
	io.Reader
}

Reader implements both the io.ByteReader and io.Reader interfaces.

func NewReader

func NewReader(r io.Reader) Reader

NewReader returns a Reader for r. If r already implements both io.ByteReader and io.Reader, NewReader returns r. Otherwise, r is wrapped to add the missing interfaces.

type Writer

type Writer interface {
	io.ByteWriter
	io.Writer
}

Writer implements both the io.ByteWriter and io.Writer interfaces.

func NewWriter

func NewWriter(w io.Writer) Writer

NewWriter returns a Writer for w. If r already implements both io.ByteWriter and io.Writer, NewWriter returns w. Otherwise, w is wrapped to add the missing interfaces.

Jump to

Keyboard shortcuts

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