Documentation
¶
Index ¶
- func Read(mem Memory, fieldName string, offset, byteCount uint32) []byte
- func ReadString(mem Memory, fieldName string, offset, byteCount uint32) string
- func TryRead(mem Memory, fieldName string, offset, byteCount uint32) ([]byte, error)
- func TryReadString(mem Memory, fieldName string, offset, byteCount uint32) (string, error)
- func TryWrite(mem Memory, fieldName string, offset uint32, data []byte) error
- func Uint16FromUint32(v uint32) (uint16, error)
- func Uint32FromInt(v int) (uint32, error)
- func Uint32FromUint64(v uint64) (uint32, error)
- func Write(mem Memory, fieldName string, offset uint32, data []byte)
- type Memory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
Read is like api.Memory except that it panics if the offset and byteCount are out of range.
func ReadString ¶
ReadString is a convenience function that casts requireRead
func TryRead ¶ added in v1.3.0
TryRead is like api.Memory except that it returns an error when the read is out of range.
func TryReadString ¶ added in v1.3.0
TryReadString is a non-panicking variant of ReadString.
func TryWrite ¶ added in v1.3.0
TryWrite is like api.Memory except that it returns an error when the write is out of range.
func Uint16FromUint32 ¶ added in v1.3.0
Uint16FromUint32 safely converts a uint32 to uint16, checking for overflow.
func Uint32FromInt ¶
Uint32FromInt safely converts an int to uint32, checking for negative values and overflow
func Uint32FromUint64 ¶ added in v1.3.0
Uint32FromUint64 safely converts a uint64 to uint32, checking for overflow.
Types ¶
Click to show internal directories.
Click to hide internal directories.