Help us shape the future of Go! Take the 2026 Go Developer Survey

binary

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader represents binary reader

func NewReader

func NewReader(data []byte, coder binary.ByteOrder) *Reader

NewReader creates a reader

func (*Reader) Alloc

func (b *Reader) Alloc() uint32

Alloc returns allocation size

func (*Reader) Bool

func (b *Reader) Bool() bool

Bool return bool

func (*Reader) Bytes

func (b *Reader) Bytes() []byte

Bytes returns bytes

func (*Reader) Float64

func (b *Reader) Float64() float64

Float64 returns float64

func (*Reader) Float64s

func (b *Reader) Float64s() []float64

Float64s returns []float64

func (*Reader) Int

func (b *Reader) Int() int

Int returns int

func (*Reader) Int32

func (b *Reader) Int32() int32

Int32 writes an int32

func (*Reader) Ints

func (b *Reader) Ints() []int

Ints returns []int

func (*Reader) String

func (b *Reader) String() string

String returns string

func (*Reader) Strings

func (b *Reader) Strings() []string

Strings returns []string

type Writer

type Writer struct {
	bytes.Buffer
	// contains filtered or unexported fields
}

Writer represents binary writer

func NewWriter

func NewWriter(coder binary.ByteOrder) *Writer

NewWriter creates a binary writer

func (*Writer) Alloc

func (b *Writer) Alloc(size uint32) error

Alloc returns allocated size

func (*Writer) Bool

func (b *Writer) Bool(v bool) error

Bool writes byte

func (*Writer) Bytes

func (b *Writer) Bytes(v []byte) error

Bytes writes bytes

func (*Writer) Float64

func (b *Writer) Float64(v float64) error

Float64 writes float64

func (*Writer) Float64s

func (b *Writer) Float64s(v []float64) error

Float64s writes float64

func (*Writer) Int

func (b *Writer) Int(v int) error

Int writes an int

func (*Writer) Int32

func (b *Writer) Int32(v int32) error

Int32 writes an int32

func (*Writer) Ints

func (b *Writer) Ints(v []int) error

Ints writes []int

func (*Writer) String

func (b *Writer) String(v string) error

String writes string v

func (*Writer) Strings

func (b *Writer) Strings(vs []string) error

Strings writes []string

func (*Writer) ToBytes

func (b *Writer) ToBytes() []byte

Jump to

Keyboard shortcuts

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