outTags.add(rewriteTag(rw, tag));
}
outMovie.setObjects(outTags);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
outMovie.encodeToStream(baos);
} catch (DataFormatException e) {
throw new BadContentException(e.getLocalizedMessage());
}
// put the new corrected length: