utils

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReadFromBuf = errors.New("error read data from buffer")
)

Functions

func ReadBytes

func ReadBytes(buf []byte, offset int, length int) ([]byte, int, error)

func ReadInt16

func ReadInt16(buf []byte, offset int) (uint16, int, error)

func ReadInt8

func ReadInt8(buf []byte, offset int) (uint8, int, error)

func ReadString

func ReadString(buf []byte, offset int, length int) (string, int, error)

func WriteBytes

func WriteBytes(buf []byte, offset int, bytes []byte) int

Write bytes array length and array itself into buffer return offset after write

func WriteInt16

func WriteInt16(buf []byte, offset int, value uint16) int

func WriteInt8

func WriteInt8(buf []byte, offset int, value uint8) int

func WriteString

func WriteString(buf []byte, offset int, value string) int

Write string len and string itself into buffer return offset after write

Types

This section is empty.

Jump to

Keyboard shortcuts

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