unsafe

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsLittleEndian = func() bool {
	test := u8Tou16([]byte{0xEF, 0xBE})

	return checkEndianess(test[0])
}()

IsLittleEndian this checks if the current system is little endian.

Functions

This section is empty.

Types

type Bytes

type Bytes struct{}

Bytes a bytes provider that uses unsafe

func (Bytes) FromF32

func (Bytes) FromF32(s []float32, d []byte, r bool) int

FromF32 copy bytes from []float32

func (Bytes) FromF64

func (Bytes) FromF64(s []float64, d []byte, r bool) int

FromF64 copy bytes from []float64

func (Bytes) FromI16

func (Bytes) FromI16(s []int16, d []byte, r bool) int

FromI16 copy bytes from []int16

func (Bytes) FromI32

func (Bytes) FromI32(s []int32, d []byte, r bool) int

FromI32 copy bytes from []int32

func (Bytes) FromI64

func (Bytes) FromI64(s []int64, d []byte, r bool) int

FromI64 copy bytes from []int64

func (Bytes) FromI8

func (Bytes) FromI8(s []int8, d []byte) int

FromI8 copy bytes from []int8

func (Bytes) FromSlice

func (Bytes) FromSlice(s interface{}, dst []byte, rotate bool) (n int, err error)

FromSlice copies bytes from the given interface. The provided interface must be a type that can be safely copied. The given slice must be large enough to fit all the bytes in `s`

func (Bytes) FromU16

func (Bytes) FromU16(s []uint16, d []byte, r bool) int

FromU16 copy bytes from []uint16

func (Bytes) FromU32

func (Bytes) FromU32(s []uint32, d []byte, r bool) int

FromU32 copy bytes from []uint32

func (Bytes) FromU64

func (Bytes) FromU64(s []uint64, d []byte, r bool) int

FromU64 copy bytes from []uint64

func (Bytes) FromValue

func (Bytes) FromValue(s reflect.Value, dst []byte, rotate bool) (n int, err error)

FromValue copies bytes from the given value. The provided value must be a type that can be safely converted to bytes. The given slice must be large enough to fit all bytes in `s`

func (Bytes) ToF32

func (Bytes) ToF32(s []byte, d []float32, r bool) int

ToF32 copy bytes to []float32

func (Bytes) ToF64

func (Bytes) ToF64(s []byte, d []float64, r bool) int

ToF64 copy bytes to []float64

func (Bytes) ToI16

func (Bytes) ToI16(s []byte, d []int16, r bool) int

ToI16 copy bytes to []int16

func (Bytes) ToI32

func (Bytes) ToI32(s []byte, d []int32, r bool) int

ToI32 copy bytes to []int32

func (Bytes) ToI64

func (Bytes) ToI64(s []byte, d []int64, r bool) int

ToI64 copy bytes to []int64

func (Bytes) ToI8

func (Bytes) ToI8(s []byte, d []int8) int

ToI8 copy bytes to []int8

func (Bytes) ToSlice

func (Bytes) ToSlice(src []byte, d interface{}, rotate bool) (n int, err error)

ToSlice copies bytes from `s` into the given slice. The given interface must be a type that can be safely written to. `d` must be large enough to fit all the bytes in `s`.

func (Bytes) ToU16

func (Bytes) ToU16(s []byte, d []uint16, r bool) int

ToU16 copy bytes to []uint16

func (Bytes) ToU32

func (Bytes) ToU32(s []byte, d []uint32, r bool) int

ToU32 copy bytes to []uint32

func (Bytes) ToU64

func (Bytes) ToU64(s []byte, d []uint64, r bool) int

ToU64 copy bytes to []uint64

func (Bytes) ToValue

func (Bytes) ToValue(src []byte, d reflect.Value, rotate bool) (n int, err error)

ToValue copies bytes from `src` into the given value The given interface must be a type that can be safely written to. `d` must be large enough to fit all the bytes in `src`

Directories

Path Synopsis
asm
gen

Jump to

Keyboard shortcuts

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