bytesutil

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: EPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteArrayToString

func ByteArrayToString(bytes []byte) string

ByteArrayToString returns a string representation of a byte array Example: [1, 2, 3, 4] => "[1, 2, 3, 4]"

func BytesToInteger

func BytesToInteger(bytes []byte) int

BytesToInteger converts a byte array to an integer (int32) (big-endian)

func BytesToLong

func BytesToLong(bytes []byte) int64

BytesToLong converts a byte array to a long (int64) (big-endian)

func BytesToShort

func BytesToShort(bytes []byte) int16

BytesToShort converts a byte array to a short (int16) (big-endian)

func BytesToString

func BytesToString(bytes []byte) string

BytesToString converts a byte array to a string (UTF-8)

func CopyOfRange

func CopyOfRange(src []byte, from, to int) []byte

CopyOfRange copies a range of bytes from src

func IntegerToBytes

func IntegerToBytes(x int) []byte

IntegerToBytes converts an integer (int32) to a byte array (big-endian)

func LongToBytes

func LongToBytes(x int64) []byte

LongToBytes converts a long (int64) to a byte array (big-endian)

func ShortToBytes

func ShortToBytes(x int16) []byte

ShortToBytes converts a short (int16) to a byte array (big-endian)

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes converts a string to a byte array (UTF-8)

Types

This section is empty.

Jump to

Keyboard shortcuts

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