reader

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package reader decodes a variable from buffer

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 the data bytes for reading

func NewReader

func NewReader(b []byte) *Reader

NewReader constructs a reader

func (*Reader) Len

func (r *Reader) Len() int

Len returns the current length of the reader's data

func (*Reader) Read

func (r *Reader) Read(n int) ([]byte, error)

Read reads n bytes and returns it

func (*Reader) Uint16

func (r *Reader) Uint16() (uint16, error)

Uint16 reads two bytes as big-endian

func (*Reader) Uint32

func (r *Reader) Uint32() (uint32, error)

Uint32 reads four bytes as big-endian

func (*Reader) Uint64

func (r *Reader) Uint64() (uint64, error)

Uint64 reads eight bytes as big-endian

func (*Reader) Uint8

func (r *Reader) Uint8() (uint8, error)

Uint8 reads a byte

Jump to

Keyboard shortcuts

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