unpack

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes4ToInt

func Bytes4ToInt(b []byte) int

4个字节转换成整形

func BytesToInt

func BytesToInt(b []byte) int

字节转换成整形

func IntToBytes

func IntToBytes(n int) []byte

整形转换成字节

func IntToBytes2

func IntToBytes2(n int) []byte

整形转换成字节2位

func IntToBytes4

func IntToBytes4(n int) []byte

整形转换成字节4位

Types

type Protocol

type Protocol struct {
	Format []string
}

func (*Protocol) Pack

func (p *Protocol) Pack(args ...any) []byte

封包

func (*Protocol) Size

func (p *Protocol) Size() int

func (*Protocol) UnPack

func (p *Protocol) UnPack(msg []byte) []any

解包

type ReadBuff

type ReadBuff []byte

func (*ReadBuff) Sub

func (b *ReadBuff) Sub(n int) ReadBuff

func (*ReadBuff) Uint16

func (b *ReadBuff) Uint16() uint16

func (*ReadBuff) Uint32

func (b *ReadBuff) Uint32() uint32

func (*ReadBuff) Uint64

func (b *ReadBuff) Uint64() uint64

func (*ReadBuff) Uint8

func (b *ReadBuff) Uint8() uint8

Jump to

Keyboard shortcuts

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