Construct a new FreeBox containing datasize padding (i.e doesnt include header 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);
}