ebml

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecodeOptions

type DecodeOptions struct {
	SkipDamaged   bool
	DecodeUnknown func(id uint32, elem *Reader) error
}

type Reader

type Reader struct {
	Dec *decoderState
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.Reader, opt *DecodeOptions) *Reader

func NewReaderBytes

func NewReaderBytes(b []byte, opt *DecodeOptions) *Reader

func (*Reader) Decode

func (r *Reader) Decode(v interface{}) error

Decode reads the next EBML-encoded value from its input and stores it in the value pointed to by v.

func (*Reader) Len

func (r *Reader) Len() int64

Len returns remaining bytes length of the Element. Returns -1 if length is not known.

func (*Reader) Next

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

func (*Reader) Read

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

Read reads the EBML-encoded element bytes into b.

func (*Reader) ReadBool

func (r *Reader) ReadBool() (bool, error)

ReadFloat reads and returns a EBML boolean value.

func (*Reader) ReadElement

func (r *Reader) ReadElement() (id uint32, elem *Reader, err error)

ReadElement reads the next EMBL-encoded element ID and size

func (*Reader) ReadFloat

func (r *Reader) ReadFloat() (float64, error)

ReadFloat reads and returns a EBML float value.

func (*Reader) ReadInt

func (r *Reader) ReadInt() (int64, error)

ReadFloat reads and returns a EBML int value.

func (*Reader) ReadString

func (r *Reader) ReadString() (string, error)

ReadString reads and returns a UTF-8 encoded EBML string value.

func (*Reader) ReadTime

func (r *Reader) ReadTime() (time.Time, error)

ReadTime reads and returns a EBML time value.

func (*Reader) ReadVInt

func (r *Reader) ReadVInt() (int64, error)

type Unmarshaler

type Unmarshaler interface {
	UnmarshalEBML(r *Reader) error
}

Unmarshaler is the interface implemented by objects that can unmarshal a EBML description of themselves. UnmarshalEBML must copy the EBML data if it wishes to retain the data after returning.

Jump to

Keyboard shortcuts

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