Documentation
¶
Overview ¶
Package ebml contains low-level EBML primitives used by container packages.
The package intentionally stops at element framing: callers remain responsible for their schema, nesting rules, and media semantics.
Index ¶
- Constants
- Variables
- func CRC32(payload []byte) uint32
- func DecodeUnsignedVINT(src []byte) (uint64, int, error)
- func EncodeID(dst []byte, id ID) (int, error)
- func EncodeSizeVINT(dst []byte, value uint64) (int, error)
- func EncodeSizeVINTWidth(dst []byte, value uint64, width int) (int, error)
- func EncodeUnknownSize(dst []byte, width int) (int, error)
- func EncodeUnsignedVINT(dst []byte, value uint64) (int, error)
- func EncodeUnsignedVINTWidth(dst []byte, value uint64, width int) (int, error)
- func IDWidth(id ID) (int, error)
- func PutCRC32(dst []byte, payload []byte) error
- func ReadUnsignedVINT(r io.Reader, scratch *[MaxSizeWidth]byte) (uint64, int, error)
- func SizeVINTWidth(value uint64) (int, error)
- func UnsignedVINTWidth(value uint64) (int, error)
- func VINTWidth(first byte) (int, error)
- func ValidateCRC32(stored []byte, payload []byte) bool
- type ElementError
- type Header
- type ID
- type Reader
- func (r *Reader) Limited(size uint64) *io.LimitedReader
- func (r *Reader) Offset() int64
- func (r *Reader) Read(p []byte) (int, error)
- func (r *Reader) ReadFull(dst []byte) error
- func (r *Reader) ReadHeader() (Header, error)
- func (r *Reader) Remaining() (uint64, bool)
- func (r *Reader) Reset(input io.Reader, options ReaderOptions)
- func (r *Reader) ResetAt(input io.Reader, options ReaderOptions, offset int64)
- func (r *Reader) Skip(size uint64) error
- type ReaderOptions
- type Size
- type SizePatch
- type Writer
- func (w *Writer) FinishSizedElement(patch SizePatch) error
- func (w *Writer) Offset() int64
- func (w *Writer) StartSizedElement(id ID, width int) (SizePatch, error)
- func (w *Writer) Write(p []byte) (int, error)
- func (w *Writer) WriteCRC32(payload []byte) error
- func (w *Writer) WriteElement(id ID, payload []byte) error
- func (w *Writer) WriteFloat64(id ID, value float64) error
- func (w *Writer) WriteHeader(id ID, size uint64) error
- func (w *Writer) WriteInt(id ID, value int64) error
- func (w *Writer) WriteString(id ID, value string) error
- func (w *Writer) WriteUInt(id ID, value uint64) error
- func (w *Writer) WriteUnknownHeader(id ID, sizeWidth int) error
- func (w *Writer) WriteVoid(payloadSize uint64) error
Constants ¶
View Source
const ( MaxIDWidth = 4 MaxSizeWidth = 8 )
Variables ¶
View Source
var ( ErrInvalidVINT = errors.New("ebml: invalid variable-size integer") ErrVINTOverflow = errors.New("ebml: variable-size integer overflow") ErrInvalidElementID = errors.New("ebml: invalid element id") ErrInvalidSize = errors.New("ebml: invalid element size") ErrUnknownSize = errors.New("ebml: unknown element size") ErrElementTooLarge = errors.New("ebml: element too large") ErrNonSeekableWriter = errors.New("ebml: writer is not seekable") )
Functions ¶
func EncodeSizeVINTWidth ¶
func EncodeUnsignedVINTWidth ¶
func ReadUnsignedVINT ¶
func SizeVINTWidth ¶
func UnsignedVINTWidth ¶
func ValidateCRC32 ¶
Types ¶
type ElementError ¶
func (*ElementError) Error ¶
func (e *ElementError) Error() string
func (*ElementError) Unwrap ¶
func (e *ElementError) Unwrap() error
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) ReadHeader ¶
type ReaderOptions ¶
type ReaderOptions struct {
MaxElementSize uint64
}
type Size ¶
func DecodeSizeVINT ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) FinishSizedElement ¶
func (*Writer) StartSizedElement ¶
func (*Writer) WriteCRC32 ¶
Click to show internal directories.
Click to hide internal directories.