private void writeNeroData(FileChannel fileReadChannel,FileChannel fileWriteChannel,Mp4BoxHeader tagsHeader) throws IOException, CannotWriteException {
  long writeBetweenIlstAndTags=tagsHeader.getFilePos() - fileReadChannel.position();
  fileWriteChannel.transferFrom(fileReadChannel,fileWriteChannel.position(),writeBetweenIlstAndTags);
  fileWriteChannel.position(fileWriteChannel.position() + writeBetweenIlstAndTags);
  convertandWriteTagsAtomToFreeAtom(fileWriteChannel,tagsHeader);
  fileReadChannel.position(tagsHeader.getFilePos() + tagsHeader.getLength());
  writeDataInChunks(fileReadChannel,fileWriteChannel);
}

private void writeNeroData ( FileChannel fileReadChannel , FileChannel fileWriteChannel , Mp4BoxHeader tagsHeader ) throws IOException , CannotWriteException { long writeBetweenIlstAndTags = tagsHeader . getFilePos ( ) - fileReadChannel . position ( ) ; fileWriteChannel . transferFrom ( fileReadChannel , fileWriteChannel . position ( ) , writeBetweenIlstAndTags ) ; fileWriteChannel . position ( fileWriteChannel . position ( ) + writeBetweenIlstAndTags ) ; convertandWriteTagsAtomToFreeAtom ( fileWriteChannel , tagsHeader ) ; fileReadChannel . position ( tagsHeader . getFilePos ( ) + tagsHeader . getLength ( ) ) ; writeDataInChunks ( fileReadChannel , fileWriteChannel ) ; }
if the existing files contains a tags atom and chp1 atom underneath the meta atom that means the file was encoded by nero . applications such as foobar read this non - standard tag before the more usual data within ilst causing problems . so the solution is to convert the tags atom and its children into a free atom whilst leaving the chp1 atom alone .
