byteUtil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitGet

func BitGet(frame byte, position int) byte

BitGet 获取指定位的值 (是从最右边开始计算)

func BitSet0

func BitSet0(frame *byte, position int)

func BitSet1

func BitSet1(frame *byte, position int)

func BytesToInt

func BytesToInt(b []byte) int

BytesToInt 字节转换成整形

func BytesToIntBigEndian

func BytesToIntBigEndian(b []byte) (int, error)

BytesToIntBigEndian (大端) []byte 转 int

func BytesToIntByOrder

func BytesToIntByOrder(b []byte, order binary.ByteOrder) int

func BytesToIntLittleEndian

func BytesToIntLittleEndian(b []byte) (int, error)

BytesToIntLittleEndian 小端[]byte 转 int

func BytesToUIntBigEndian

func BytesToUIntBigEndian(b []byte) (int, error)

BytesToUIntBigEndian (大端) []byte 转 uint

func BytesToUIntLittleEndian

func BytesToUIntLittleEndian(b []byte) (int, error)

BytesToUIntLittleEndian (小端) []byte 转 uint

func InToBytesByOrder

func InToBytesByOrder(n int, order binary.ByteOrder) []byte

func IntToBytes

func IntToBytes(n int) []byte

IntToBytes 整形转换成字节

func IntToBytesBigEndian

func IntToBytesBigEndian(n int64, bytesLength byte) ([]byte, error)

IntToBytesBigEndian int 转大端 []byte

func IntToBytesLittleEndian

func IntToBytesLittleEndian(n int64, bytesLength byte) ([]byte, error)

IntToBytesLittleEndian int 转小端 []byte

func Poll2Byte

func Poll2Byte(frame *[]byte) int16

func Poll4Byte

func Poll4Byte(frame *[]byte) int32

func Print

func Print(frame []byte) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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