binarystream

package module
Version: v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: GPL-3.0 Imports: 3 Imported by: 1

README

BinaryUtils

Functions used to encode native GoLang datatypes to bytes. This package is required to communicate efficiently between the GipfelAC-Processor and Client.

Supported datatypes

  • int8
  • int16
  • int32
  • int64
  • float32
  • float64
  • uint8 / byte
  • uint16
  • uint32
  • uint64
  • variable length strings

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PutBool

func PutBool(b bool) (byte, uint)

func PutFloat32

func PutFloat32(f float32) ([]byte, uint)

func PutFloat64

func PutFloat64(f float64) ([]byte, uint)

func PutInt16

func PutInt16(i int16) ([]byte, uint)

func PutInt32

func PutInt32(i int32) ([]byte, uint)

func PutInt64

func PutInt64(i int64) ([]byte, uint)

func PutInt8

func PutInt8(i int8) (byte, uint)

func PutString

func PutString(s string) ([]byte, uint)

func PutUInt16

func PutUInt16(i uint16) ([]byte, uint)

func PutUInt32

func PutUInt32(i uint32) ([]byte, uint)

func PutUInt64

func PutUInt64(i uint64) ([]byte, uint)

func PutUInt8

func PutUInt8(i uint8) (byte, uint)

func ReadBool

func ReadBool(b byte) (bool, uint)

func ReadFloat32

func ReadFloat32(b []byte) (float32, uint)

func ReadFloat64

func ReadFloat64(b []byte) (float64, uint)

func ReadInt16

func ReadInt16(b []byte) (int16, uint)

func ReadInt32

func ReadInt32(b []byte) (int32, uint)

func ReadInt64

func ReadInt64(b []byte) (int64, uint)

func ReadInt8

func ReadInt8(b byte) (int8, uint)

func ReadString

func ReadString(b []byte) (string, uint)

func ReadUInt16

func ReadUInt16(b []byte) (uint16, uint)

func ReadUInt32

func ReadUInt32(b []byte) (uint32, uint)

func ReadUInt64

func ReadUInt64(b []byte) (uint64, uint)

func ReadUInt8

func ReadUInt8(b byte) (uint8, uint)

Types

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func NewStream

func NewStream(b []byte) *Stream

func (*Stream) Bytes

func (s *Stream) Bytes() []byte

func (*Stream) PutByte added in v0.5.3

func (s *Stream) PutByte(b byte)

func (*Stream) PutBytes

func (s *Stream) PutBytes(b ...byte)

func (*Stream) ReadByte added in v0.5.3

func (s *Stream) ReadByte() byte

func (*Stream) ReadBytes

func (s *Stream) ReadBytes(length uint) []byte

func (*Stream) RearrangeOffset

func (s *Stream) RearrangeOffset(amount uint) error

func (*Stream) RemainingBytes added in v0.5.6

func (s *Stream) RemainingBytes() []byte

func (*Stream) Reset

func (s *Stream) Reset()

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL