bytesiterator

package
v1.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesIter

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

BytesIter facilitates sequential reading of bytes from a byte slice.

func New

func New(data []byte) *BytesIter

New initializes a new BytesIter with the provided data.

func (*BytesIter) BytesLeft

func (iter *BytesIter) BytesLeft() int

BytesLeft returns the number of bytes that are left unread.

func (*BytesIter) IsEmpty

func (iter *BytesIter) IsEmpty() bool

IsEmpty checks if there are no more bytes to read.

func (*BytesIter) NextByte

func (iter *BytesIter) NextByte() (byte, error)

NextByte reads the next single byte.

func (*BytesIter) NextBytes

func (iter *BytesIter) NextBytes(n int) ([]byte, error)

NextBytes reads the next n bytes and returns them as a byte slice.

func (*BytesIter) NextString

func (iter *BytesIter) NextString(n int) (string, error)

NextString reads the next n bytes and returns them as a string.

func (*BytesIter) NextUint16

func (iter *BytesIter) NextUint16() (*big.Int, error)

NextUint16 reads the next 2 bytes and returns them as a *big.Int.

func (*BytesIter) NextUint160

func (iter *BytesIter) NextUint160() (*big.Int, error)

NextUint160 reads the next 20 bytes and returns them as a *big.Int.

func (*BytesIter) NextUint24

func (iter *BytesIter) NextUint24() (uint32, error)

NextUint24 reads the next 3 bytes and returns them as a uint32.

func (*BytesIter) NextUint256

func (iter *BytesIter) NextUint256() (*big.Int, error)

NextUint256 reads the next 32 bytes and returns them as a *big.Int.

func (*BytesIter) NextUint32

func (iter *BytesIter) NextUint32() (*big.Int, error)

NextUint32 reads the next 4 bytes and returns them as a *big.Int.

func (*BytesIter) Rest

func (iter *BytesIter) Rest() ([]byte, error)

Rest returns the remaining bytes as a byte slice.

Jump to

Keyboard shortcuts

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