ebml

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

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

Go to latest
Published: Nov 14, 2022 License: BSD-3-Clause Imports: 7 Imported by: 5

README

ebml-go // ebml

Package ebml provides an implementation of an EBML decoder in the Go Programming Language.

EBML is short for Extensible Binary Meta Language. EBML specifies a binary and octet (byte) aligned format inspired by the principle of XML. EBML itself is a generalized description of the technique of binary markup. Like XML, it is completely agnostic to any data that it might contain. For a specification, see http://ebml.sourceforge.net/specs/.

Installation
go get github.com/ebml-go/ebml
Usage

See WebM Parser.

LICENSE

The BSD 3-Clause License.

Documentation

Overview

Package ebml decodes EBML data.

EBML is short for Extensible Binary Meta Language. EBML specifies a binary and octet (byte) aligned format inspired by the principle of XML. EBML itself is a generalized description of the technique of binary markup. Like XML, it is completely agnostic to any data that it might contain. For a specification, see http://ebml.sourceforge.net/specs/

Index

Constants

This section is empty.

Variables

View Source
var Verbose bool = false

Functions

This section is empty.

Types

type Element

type Element struct {
	Offset int64
	Id     uint
	// contains filtered or unexported fields
}

Element represents an EBML-encoded chunk of data.

func RootElement

func RootElement(rs io.ReadSeeker) (*Element, error)

Creates the root element corresponding to the data available in r.

func (*Element) Next

func (e *Element) Next() (*Element, error)

Next returns the next child element in an element.

func (*Element) ReadData

func (e *Element) ReadData() (d []byte, err error)

func (Element) Seek

func (lrs Element) Seek(offset int64, whence int) (ret int64, err error)

func (*Element) Size

func (e *Element) Size() int64

func (*Element) String

func (e *Element) String() string

func (*Element) Unmarshal

func (e *Element) Unmarshal(val interface{}) error

Unmarshal reads EBML data from r into data. Data must be a pointer to a struct. Fields present in the struct but absent in the stream will just keep their zero value. Returns an error that can be an io.Error or a ReachedPayloadError.

type ReachedPayloadError

type ReachedPayloadError struct {
	*Element
}

ReachedPayloadError is generated when a field tagged with ebmlstop:"1" is reached.

func (ReachedPayloadError) Error

func (r ReachedPayloadError) Error() string

func (ReachedPayloadError) Seek

func (lrs ReachedPayloadError) Seek(offset int64, whence int) (ret int64, err error)

Jump to

Keyboard shortcuts

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