astibyte

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 License: MIT Imports: 1 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PadLeft

func PadLeft(i []byte, rpl byte, length int) []byte

PadLeft adds n rpl to the left of i so that len is length

func PadRight

func PadRight(i []byte, rpl byte, length int) []byte

PadRight adds n rpl to the right of i so that len is length

func ToLength

func ToLength(i []byte, rpl byte, length int) []byte

ToLength forces the length of a []byte

Types

type Iterator added in v1.1.0

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

Iterator represents an object capable of iterating sequentially and safely through a slice of bytes

func NewIterator added in v1.1.0

func NewIterator(bs []byte) *Iterator

NewIterator creates a new iterator

func (*Iterator) Dump added in v1.1.0

func (i *Iterator) Dump() (bs []byte)

Dump dumps the rest of the slice

func (*Iterator) FastForward added in v1.1.0

func (i *Iterator) FastForward(delta int)

FastForward increments the iterator's offset

func (*Iterator) HasBytesLeft added in v1.1.0

func (i *Iterator) HasBytesLeft() bool

HasBytesLeft checks whether the slice has some bytes left

func (*Iterator) Len added in v1.1.0

func (i *Iterator) Len() int

Len returns the slice length

func (*Iterator) NextByte added in v1.1.0

func (i *Iterator) NextByte() (b byte, err error)

NextByte returns the slice's next byte

func (*Iterator) NextBytes added in v1.1.0

func (i *Iterator) NextBytes(n int) (bs []byte, err error)

NextBytes returns the n slice's next bytes

func (*Iterator) Offset added in v1.1.0

func (i *Iterator) Offset() int

Offset returns the offset

func (*Iterator) Seek added in v1.1.0

func (i *Iterator) Seek(offset int)

Seek sets the iterator's offset

Jump to

Keyboard shortcuts

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