encoding

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeFloat32

func DecodeFloat32(buf []byte) float32

func DecodeFloat32s

func DecodeFloat32s(buf []byte) (v []float32)

func DecodeFloat64

func DecodeFloat64(buf []byte) float64

func DecodeFloat64s

func DecodeFloat64s(buf []byte) (v []float64)

func DecodeUint16

func DecodeUint16(buf []byte) uint16

func DecodeUint16s

func DecodeUint16s(buf []byte) (v []uint16)

func DecodeUint32

func DecodeUint32(buf []byte) uint32

func DecodeUint32s

func DecodeUint32s(buf []byte) (v []uint32)

func DecodeUint64

func DecodeUint64(buf []byte) uint64

func DecodeUint64s

func DecodeUint64s(buf []byte) (v []uint64)

func EncodeFloat32

func EncodeFloat32(buf []byte, v float32) []byte

func EncodeFloat32s

func EncodeFloat32s(buf []byte, v []float32) []byte

func EncodeFloat64

func EncodeFloat64(buf []byte, v float64) []byte

func EncodeFloat64s

func EncodeFloat64s(buf []byte, v []float64) []byte

func EncodeUint16

func EncodeUint16(buf []byte, v uint16) []byte

func EncodeUint16s

func EncodeUint16s(buf []byte, v []uint16) []byte

func EncodeUint32

func EncodeUint32(buf []byte, v uint32) []byte

func EncodeUint32s

func EncodeUint32s(buf []byte, v []uint32) []byte

func EncodeUint64

func EncodeUint64(buf []byte, v uint64) []byte

func EncodeUint64s

func EncodeUint64s(buf []byte, v []uint64) []byte

func Pipe

func Pipe() (r Reader, w Writer)

Types

type Buffer added in v0.3.0

type Buffer struct {
	*bytes.Buffer
	// contains filtered or unexported fields
}

func NewBuffer added in v0.3.0

func NewBuffer(buf []byte) (b *Buffer)

func (*Buffer) Close added in v0.3.0

func (b *Buffer) Close() error

func (*Buffer) ReadBool added in v0.3.0

func (r *Buffer) ReadBool() (v bool, err error)

func (*Buffer) ReadBools added in v0.3.0

func (r *Buffer) ReadBools() (v []bool, err error)

func (*Buffer) ReadByte added in v0.3.0

func (b *Buffer) ReadByte() (v byte, err error)

func (*Buffer) ReadBytes added in v0.3.0

func (b *Buffer) ReadBytes() (v []byte, err error)

func (*Buffer) ReadFloat32 added in v0.3.0

func (r *Buffer) ReadFloat32() (v float32, err error)

func (*Buffer) ReadFloat32s added in v0.3.0

func (r *Buffer) ReadFloat32s() (v []float32, err error)

func (*Buffer) ReadFloat64 added in v0.3.0

func (r *Buffer) ReadFloat64() (v float64, err error)

func (*Buffer) ReadFloat64s added in v0.3.0

func (r *Buffer) ReadFloat64s() (v []float64, err error)

func (*Buffer) ReadString added in v0.3.0

func (b *Buffer) ReadString() (v string, err error)

func (*Buffer) ReadUint16 added in v0.3.0

func (r *Buffer) ReadUint16() (v uint16, err error)

func (*Buffer) ReadUint16s added in v0.3.0

func (r *Buffer) ReadUint16s() (v []uint16, err error)

func (*Buffer) ReadUint32 added in v0.3.0

func (r *Buffer) ReadUint32() (v uint32, err error)

func (*Buffer) ReadUint32s added in v0.3.0

func (r *Buffer) ReadUint32s() (v []uint32, err error)

func (*Buffer) ReadUint64 added in v0.3.0

func (r *Buffer) ReadUint64() (v uint64, err error)

func (*Buffer) ReadUint64s added in v0.3.0

func (r *Buffer) ReadUint64s() (v []uint64, err error)

func (*Buffer) WriteBool added in v0.3.0

func (w *Buffer) WriteBool(v bool) error

func (*Buffer) WriteBools added in v0.3.0

func (w *Buffer) WriteBools(v []bool) error

func (*Buffer) WriteByte added in v0.3.0

func (b *Buffer) WriteByte(v byte) (err error)

func (*Buffer) WriteBytes added in v0.3.0

func (w *Buffer) WriteBytes(v []byte) (err error)

func (*Buffer) WriteFloat32 added in v0.3.0

func (w *Buffer) WriteFloat32(v float32) (err error)

func (*Buffer) WriteFloat32s added in v0.3.0

func (w *Buffer) WriteFloat32s(v []float32) (err error)

func (*Buffer) WriteFloat64 added in v0.3.0

func (w *Buffer) WriteFloat64(v float64) (err error)

func (*Buffer) WriteFloat64s added in v0.3.0

func (w *Buffer) WriteFloat64s(v []float64) (err error)

func (*Buffer) WriteString added in v0.3.0

func (b *Buffer) WriteString(v string) (err error)

func (*Buffer) WriteUint16 added in v0.3.0

func (w *Buffer) WriteUint16(v uint16) (err error)

func (*Buffer) WriteUint16s added in v0.3.0

func (w *Buffer) WriteUint16s(v []uint16) (err error)

func (*Buffer) WriteUint32 added in v0.3.0

func (w *Buffer) WriteUint32(v uint32) (err error)

func (*Buffer) WriteUint32s added in v0.3.0

func (w *Buffer) WriteUint32s(v []uint32) (err error)

func (*Buffer) WriteUint64 added in v0.3.0

func (w *Buffer) WriteUint64(v uint64) (err error)

func (*Buffer) WriteUint64s added in v0.3.0

func (w *Buffer) WriteUint64s(v []uint64) (err error)

type Reader

type Reader interface {
	io.Closer
	io.Reader
	ReadBool() (v bool, err error)
	ReadByte() (v byte, err error)
	ReadUint16() (v uint16, err error)
	ReadUint32() (v uint32, err error)
	ReadUint64() (v uint64, err error)
	ReadFloat32() (v float32, err error)
	ReadFloat64() (v float64, err error)
	ReadString() (v string, err error)
	ReadBools() (v []bool, err error)
	ReadBytes() (v []byte, err error)
	ReadUint16s() (v []uint16, err error)
	ReadUint32s() (v []uint32, err error)
	ReadUint64s() (v []uint64, err error)
}

func WrapReader

func WrapReader(old io.Reader) Reader

type Writer

type Writer interface {
	io.Closer
	io.Writer
	WriteBool(v bool) error
	WriteByte(v byte) error
	WriteUint16(v uint16) error
	WriteUint32(v uint32) error
	WriteUint64(v uint64) error
	WriteFloat32(v float32) error
	WriteFloat64(v float64) error
	WriteString(v string) error
	WriteBools(v []bool) error
	WriteBytes(v []byte) error
	WriteUint16s(v []uint16) error
	WriteUint32s(v []uint32) error
	WriteUint64s(v []uint64) error
	WriteFloat32s(v []float32) error
	WriteFloat64s(v []float64) error
}

func WrapWriter

func WrapWriter(old io.Writer) Writer

Jump to

Keyboard shortcuts

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