bindec

package module
v0.0.0-...-d5317a2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 4 Imported by: 0

README

bindec

Helper type that wraps the encoding/binary package

dec := bindec.NewDecoder(reader, binary.LittleEndian)
size, _ := dec.Int16(nil)
header, _ := dec.Bytes(int(size))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	R *bufio.Reader
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(r io.Reader, order binary.ByteOrder) *Decoder

func (Decoder) Bytes

func (d Decoder) Bytes(n int) ([]byte, error)

func (Decoder) Int

func (d Decoder) Int(bitSize int, order binary.ByteOrder) (int, error)

func (Decoder) Int16

func (d Decoder) Int16(order binary.ByteOrder) (int16, error)

func (Decoder) Int32

func (d Decoder) Int32(order binary.ByteOrder) (int32, error)

func (Decoder) Int64

func (d Decoder) Int64(order binary.ByteOrder) (int64, error)

func (Decoder) Uint

func (d Decoder) Uint(bitSize int, order binary.ByteOrder) (uint, error)

func (Decoder) Uint16

func (d Decoder) Uint16(order binary.ByteOrder) (uint16, error)

func (Decoder) Uint32

func (d Decoder) Uint32(order binary.ByteOrder) (uint32, error)

func (Decoder) Uint64

func (d Decoder) Uint64(order binary.ByteOrder) (uint64, error)

Jump to

Keyboard shortcuts

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