varlen

package
v0.0.0-...-b05aa3b Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadByte

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

ReadByte read a single byte

func ReadBytes

func ReadBytes(r io.Reader) ([]byte, error)

ReadBytes read a byte slice

func ReadFloat32

func ReadFloat32(r io.Reader) (float32, error)

ReadFloat32 read a float32

func ReadFloat64

func ReadFloat64(r io.Reader) (float64, error)

ReadFloat64 read a float64

func ReadInt32

func ReadInt32(r io.Reader) (int32, error)

ReadInt32 read a signed varint and make sure it is in the range of int32

func ReadInt64

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

ReadInt64 read a signed varint

func ReadString

func ReadString(r io.Reader) (string, error)

ReadString read a string

func ReadTimeMsecs

func ReadTimeMsecs(r io.Reader) (t time.Time, err error)

func ReadUint32

func ReadUint32(r io.Reader) (uint32, error)

ReadUint32 read an unsigned varint and make sure it is in the range of uint32

func ReadUint64

func ReadUint64(r io.Reader) (uint64, error)

ReadUint64 read an unsigned varint

func UvariantSize

func UvariantSize(x uint64) int

UvariantSize caculatre bytes length of an unsigned varint

func VariantSize

func VariantSize(x int64) int

VariantSize caculatre bytes length of an signed varint

func WriteByte

func WriteByte(w io.Writer, c byte) error

WriteByte write a single byte

func WriteBytes

func WriteBytes(w io.Writer, s []byte) error

WriteBytes write a byte slice

func WriteFloat32

func WriteFloat32(w io.Writer, v float32) error

WriteFloat32 write a float32

func WriteFloat64

func WriteFloat64(w io.Writer, v float64) error

WriteFloat64 write a float64

func WriteInt32

func WriteInt32(w io.Writer, x int32) error

WriteInt32 是辅助函数, 写入一个变长整数

func WriteInt64

func WriteInt64(w io.Writer, x int64) error

WriteInt64 write an unsigned varint

func WriteString

func WriteString(w io.Writer, s string) error

WriteString write a stirng

func WriteTimeMsecs

func WriteTimeMsecs(w io.Writer, t time.Time) error

func WriteUint32

func WriteUint32(w io.Writer, x uint32) error

WriteUint32 write an unsigned varint

func WriteUint64

func WriteUint64(w io.Writer, x uint64) error

WriteUint64 write an unsigned varint

Types

This section is empty.

Jump to

Keyboard shortcuts

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