Class MatroskaElement

  • Direct Known Subclasses:
    MutableMatroskaElement

    public class MatroskaElement
    extends java.lang.Object
    Matroska container element.
    • Field Detail

      • level

        protected final int level
      • id

        protected long id
      • position

        protected long position
      • headerSize

        protected int headerSize
      • dataSize

        protected int dataSize
    • Constructor Detail

      • MatroskaElement

        protected MatroskaElement​(int level)
    • Method Detail

      • getLevel

        public int getLevel()
        Returns:
        The depth of the element in the element tree.
      • getId

        public long getId()
        Returns:
        The EBML code of the element.
      • getType

        public MatroskaElementType getType()
        Returns:
        Element type, Unknown if not listed in the enum.
      • getPosition

        public long getPosition()
        Returns:
        Absolute position of the element in the file.
      • getHeaderSize

        public int getHeaderSize()
        Returns:
        Size of the header in bytes.
      • getDataSize

        public int getDataSize()
        Returns:
        Size of the payload in bytes.
      • is

        public boolean is​(MatroskaElementType type)
        Parameters:
        type - Element type.
        Returns:
        True if this element is of the specified type.
      • is

        public boolean is​(MatroskaElementType.DataType dataType)
        Parameters:
        dataType - Element data type.
        Returns:
        True if the type of the element uses the specified data type.
      • getRemaining

        public long getRemaining​(long currentPosition)
        Parameters:
        currentPosition - Absolute position to check against.
        Returns:
        The number of bytes from the specified position to the end of this element.
      • getDataPosition

        public long getDataPosition()
        Returns:
        The absolute position of the data of this element.
      • frozen

        public MatroskaElement frozen()
        Returns:
        A frozen version of the element safe to keep for later use.