binary

package
v0.0.0-...-cbdf446 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MinTriad is the minimum value of Triad
	MinTriad = 0

	// MaxTriad is the maximum value of Triad
	MaxTriad = 16777216
)
View Source
const TriadSize = 3

TriadSize is the Triad length(bytes)

Variables

This section is empty.

Functions

func WriteLTriad

func WriteLTriad(v Triad) []byte

WriteTriad writes Triad value as LittleEndian

func WriteTriad

func WriteTriad(v Triad) []byte

WriteTriad writes Triad value

Types

type Stream

type Stream struct {
	binary.Stream
}

Stream is binary stream

func NewStream

func NewStream() *Stream

NewStream returns new Stream

func NewStreamBytes

func NewStreamBytes(b []byte) *Stream

NewStream returns new Stream with bytes

func (*Stream) LTriad

func (bs *Stream) LTriad() (Triad, error)

LTriad sets triad got from buffer as LittleEndian to value

func (*Stream) PutLTriad

func (bs *Stream) PutLTriad(value Triad) error

PutLTriad puts triad from value to buffer as LittleEndian

func (*Stream) PutTriad

func (bs *Stream) PutTriad(value Triad) error

PutTriad puts triad from value to buffer

func (*Stream) Triad

func (bs *Stream) Triad() (Triad, error)

Triad sets triad got from buffer to value

type Triad

type Triad uint32

Triad is a type of 3bytes

func ReadELTriad

func ReadELTriad(v []byte) (Triad, error)

ReadELTriad reads Triad value as LittleEndian with error

func ReadETriad

func ReadETriad(v []byte) (Triad, error)

ReadETriad reads Triad value with error

func ReadLTriad

func ReadLTriad(v []byte) Triad

ReadLTriad reads Triad value as LittleEndian

func ReadTriad

func ReadTriad(v []byte) Triad

ReadTriad reads Triad value

Jump to

Keyboard shortcuts

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