org.jaudiotagger.audio.mp4
Class Mp4FileWriter

java.lang.Object
  extended by org.jaudiotagger.audio.generic.AudioFileWriter
      extended by org.jaudiotagger.audio.mp4.Mp4FileWriter

public class Mp4FileWriter
extends AudioFileWriter

Mp4 File Writer

This can write files containing either the .mp4 or .m4a suffixes


Field Summary
private  Mp4TagWriter tw
           
 
Fields inherited from class org.jaudiotagger.audio.generic.AudioFileWriter
logger
 
Constructor Summary
Mp4FileWriter()
           
 
Method Summary
protected  void deleteTag(java.io.RandomAccessFile raf, java.io.RandomAccessFile rafTemp)
          Same as above, but delete tag in the file.
protected  void writeTag(Tag tag, java.io.RandomAccessFile raf, java.io.RandomAccessFile rafTemp)
          This is called when a tag has to be written in a file.
 
Methods inherited from class org.jaudiotagger.audio.generic.AudioFileWriter
delete, delete, setAudioFileModificationListener, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tw

private Mp4TagWriter tw
Constructor Detail

Mp4FileWriter

public Mp4FileWriter()
Method Detail

writeTag

protected void writeTag(Tag tag,
                        java.io.RandomAccessFile raf,
                        java.io.RandomAccessFile rafTemp)
                 throws CannotWriteException,
                        java.io.IOException
Description copied from class: AudioFileWriter
This is called when a tag has to be written in a file. Three parameters are provided, the tag to write (not empty) Two randomaccessfiles, the first points to the file where we want to write the given tag, and the second is an empty temporary file that can be used if e.g. the file has to be bigger than the original.

If something has been written in the temporary file, when this method returns, the original file is deleted, and the temporary file is renamed the the original name

If nothing has been written to it, it is simply deleted.

This method can assume the raf, rafTemp are pointing to the first byte of the file. The subclass must not close these two files when the method returns.

Specified by:
writeTag in class AudioFileWriter
Throws:
CannotWriteException - when an error occured during the generation of the tag
java.io.IOException - is thrown when the RandomAccessFile operations throw it (you should never throw them manually)

deleteTag

protected void deleteTag(java.io.RandomAccessFile raf,
                         java.io.RandomAccessFile rafTemp)
                  throws java.io.IOException
Description copied from class: AudioFileWriter
Same as above, but delete tag in the file.

Specified by:
deleteTag in class AudioFileWriter
Throws:
java.io.IOException - is thrown when the RandomAccessFile operations throw it (you should never throw them manually)