FileDocCategorySizeDatePackage
Mp4FreeBox.javaAPI DocJaudiotagger 2.0.41550Wed Mar 30 16:11:44 BST 2011org.jaudiotagger.audio.mp4.atom

Mp4FreeBox

public class Mp4FreeBox extends AbstractMp4Box
FreeBox ( padding)

There are usually two free boxes, one beneath the meta atom and one toplevel atom

Fields Summary
Constructors Summary
public Mp4FreeBox(int datasize)
Construct a new FreeBox containing datasize padding (i.e doesnt include header size)

param
datasize padding size

        try
        {
            //Header
            header = new Mp4BoxHeader();
            ByteArrayOutputStream headerBaos = new ByteArrayOutputStream();
            headerBaos.write(Utils.getSizeBEInt32(Mp4BoxHeader.HEADER_LENGTH + datasize));
            headerBaos.write(Utils.getDefaultBytes(Mp4AtomIdentifier.FREE.getFieldName(), "ISO-8859-1"));
            header.update(ByteBuffer.wrap(headerBaos.toByteArray()));

            //Body
            ByteArrayOutputStream freeBaos = new ByteArrayOutputStream();
            for (int i = 0; i < datasize; i++)
            {
                freeBaos.write(0x0);
            }
            dataBuffer = ByteBuffer.wrap(freeBaos.toByteArray());
        }
        catch (IOException ioe)
        {
            //This should never happen as were not actually writing to/from a file
            throw new RuntimeException(ioe);
        }
    
Methods Summary