Class FullContainerBox

All Implemented Interfaces:
Box, Container, FullBox, ParsableBox

public abstract class FullContainerBox extends AbstractContainerBox implements FullBox
Abstract base class for a full tools box only containing ither boxes.
  • Constructor Details

    • FullContainerBox

      public FullContainerBox(String type)
  • Method Details

    • getVersion

      public int getVersion()
      Specified by:
      getVersion in interface FullBox
    • setVersion

      public void setVersion(int version)
      Specified by:
      setVersion in interface FullBox
    • getFlags

      public int getFlags()
      Specified by:
      getFlags in interface FullBox
    • setFlags

      public void setFlags(int flags)
      Specified by:
      setFlags in interface FullBox
    • getBoxes

      public <T extends Box> List<T> getBoxes(Class<T> clazz)
      Description copied from interface: Container
      Gets all child boxes of the given type. May not return null.
      Specified by:
      getBoxes in interface Container
      Overrides:
      getBoxes in class BasicContainer
      Type Parameters:
      T - type of boxes to get
      Parameters:
      clazz - child box's type
      Returns:
      an array of boxes, empty array in case of no children.
    • parse

      public void parse(ReadableByteChannel dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException
      Description copied from interface: ParsableBox
      Parses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]). The remaining size of the box is the contentSize, contentSize number of bytes should be read from the box source (readableByteChannel). If you need the header buffer at a later stage you have to create a copy.
      Specified by:
      parse in interface ParsableBox
      Overrides:
      parse in class AbstractContainerBox
      Parameters:
      dataSource - the source for this box
      header - the box' already parsed header (create copy if you need it later as it will be overwritten)
      contentSize - remaining bytes of this box
      boxParser - use it to parse sub-boxes.
      Throws:
      IOException - in case of an error during a read operation
    • getBox

      public void getBox(WritableByteChannel writableByteChannel) throws IOException
      Description copied from interface: Box
      Writes the complete box - size | 4-cc | content - to the given writableByteChannel.
      Specified by:
      getBox in interface Box
      Overrides:
      getBox in class AbstractContainerBox
      Parameters:
      writableByteChannel - the box's sink
      Throws:
      IOException - in case of problems with the Channel
    • toString

      public String toString()
      Overrides:
      toString in class BasicContainer
    • parseVersionAndFlags

      protected final long parseVersionAndFlags(ByteBuffer content)
      Parses the version/flags header and returns the remaining box size.
      Parameters:
      content - the ByteBuffer that contains the version & flag
      Returns:
      number of bytes read
    • writeVersionAndFlags

      protected final void writeVersionAndFlags(ByteBuffer bb)
    • getHeader

      protected ByteBuffer getHeader()
      Overrides:
      getHeader in class AbstractContainerBox