bytes

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

type Bytes interface {
	Raw
	Reader
	Writer
	Slice(offset int, size int) Bytes
	LittleEndian() Bytes
	BigEndian() Bytes
}

Bytes object for manipulating arbitrary byte arrays.

func New

func New(data *[]byte) Bytes

New raw bytearray.

func NewBigEndian

func NewBigEndian(data *[]byte) Bytes

NewBigEndian big endian ordering of bytes.

func NewLittleEndian

func NewLittleEndian(data *[]byte) Bytes

NewLittleEndian little endian ordering of bytes.

type Raw

type Raw interface {
	Raw() *[]byte
}

Raw returns just the bytes without any assumptions about layout.

type Reader

type Reader interface {
	Read8(pos int) uint8
	Read16(pos int) uint16
	Read32(pos int) uint32
	Read64(pos int) uint64
	Len() int
}

Reader used to read various data sizes in the byte array.

type Writer

type Writer interface {
	Write8(pos int, value uint8)
	Write16(pos int, value uint16)
	Write32(pos int, value uint32)
	Write64(pos int, value uint64)
	Len() int
}

Writer used to write various sizes of data in the byte array.

Jump to

Keyboard shortcuts

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