basic

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const MaxStringSize = uint32(10 * 1024 * 1024)

MaxStringSize the longest string allowed.

Variables

This section is empty.

Functions

func ReadBool

func ReadBool(r io.Reader) (bool, error)

ReadBool read a one byte size binary value

func ReadFloat32

func ReadFloat32(r io.Reader) (float32, error)

ReadFloat32 read a little endian float32

func ReadFloat64

func ReadFloat64(r io.Reader) (float64, error)

ReadFloat64 read a little endian float64

func ReadInt16

func ReadInt16(r io.Reader) (int16, error)

ReadInt16 reads a little endian int16

func ReadInt32

func ReadInt32(r io.Reader) (int32, error)

ReadInt32 reads a little endian int32

func ReadInt64

func ReadInt64(r io.Reader) (int64, error)

ReadInt64 reads a little endian int64

func ReadInt8

func ReadInt8(r io.Reader) (int8, error)

ReadInt8 reads a little endian int8

func ReadN

func ReadN(r io.Reader, buf []byte, length int) error

ReadN tries and retries to read length bytes from r. Reading length with io.EOF is not considered an error. Forwards io.EOF if nothing was read.

func ReadString

func ReadString(r io.Reader) (string, error)

ReadString reads a string: first the size of the string is read using ReadUint32, then the bytes of the string.

func ReadUint16

func ReadUint16(r io.Reader) (uint16, error)

ReadUint16 reads a little endian uint16

func ReadUint32

func ReadUint32(r io.Reader) (uint32, error)

ReadUint32 reads a little endian uint32

func ReadUint64

func ReadUint64(r io.Reader) (uint64, error)

ReadUint64 read a little endian uint64

func ReadUint8

func ReadUint8(r io.Reader) (uint8, error)

ReadUint8 read an uint8

func WriteBool

func WriteBool(b bool, w io.Writer) error

WriteBool writes a one byte size binary value

func WriteFloat32

func WriteFloat32(f float32, w io.Writer) error

WriteFloat32 writes a little endian float32

func WriteFloat64

func WriteFloat64(f float64, w io.Writer) error

WriteFloat64 writes a little endian float64

func WriteInt16

func WriteInt16(i int16, w io.Writer) error

WriteInt16 writes a little endian int16

func WriteInt32

func WriteInt32(i int32, w io.Writer) error

WriteInt32 writes a little endian int32

func WriteInt64

func WriteInt64(i int64, w io.Writer) error

WriteInt64 writes a little endian int64

func WriteInt8

func WriteInt8(i int8, w io.Writer) error

WriteInt8 writes a little endian int8

func WriteN

func WriteN(w io.Writer, buf []byte, length int) error

WriteN tries and retries to write length bytes into w. Writing length with io.EOF is not considered an error. Forwards io.EOF if nothing was written.

func WriteString

func WriteString(s string, w io.Writer) error

WriteString writes a string: first the size of the string is written using WriteUint32, then the bytes of the string.

func WriteUint16

func WriteUint16(i uint16, w io.Writer) error

WriteUint16 writes a little endian uint16

func WriteUint32

func WriteUint32(i uint32, w io.Writer) error

WriteUint32 writes a little endian uint32

func WriteUint64

func WriteUint64(i uint64, w io.Writer) error

WriteUint64 writes a little endian uint64

func WriteUint8

func WriteUint8(i uint8, w io.Writer) error

WriteUint8 an uint8

Types

This section is empty.

Jump to

Keyboard shortcuts

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