encoding

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBytes

func DecodeBytes(bz []byte) ([]byte, int, error)

decodeBytes decodes a varint length-prefixed byte slice, returning it along with the number of input bytes read.

func DecodeUvarint

func DecodeUvarint(bz []byte) (uint64, int, error)

decodeUvarint decodes a varint-encoded unsigned integer from a byte slice, returning it and the number of bytes decoded.

func DecodeVarint

func DecodeVarint(bz []byte) (int64, int, error)

decodeVarint decodes a varint-encoded integer from a byte slice, returning it and the number of bytes decoded.

func EncodeBytes

func EncodeBytes(w io.Writer, bz []byte) error

EncodeBytes writes a varint length-prefixed byte slice to the writer.

func EncodeBytesSize

func EncodeBytesSize(bz []byte) int

encodeBytesSize returns the byte size of the given slice including length-prefixing.

func EncodeBytesSlice

func EncodeBytesSlice(bz []byte) ([]byte, error)

encodeBytesSlice length-prefixes the byte slice and returns it.

func EncodeUvarint

func EncodeUvarint(w io.Writer, u uint64) error

EncodeUvarint writes a varint-encoded unsigned integer to an io.Writer.

func EncodeUvarintSize

func EncodeUvarintSize(u uint64) int

EncodeUvarintSize returns the byte size of the given integer as a varint.

func EncodeVarint

func EncodeVarint(w io.Writer, i int64) error

EncodeVarint writes a varint-encoded integer to an io.Writer.

func EncodeVarintSize

func EncodeVarintSize(i int64) int

EncodeVarintSize returns the byte size of the given integer as a varint.

Types

This section is empty.

Jump to

Keyboard shortcuts

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