org.jaudiotagger.audio.mp3
Class MP3FileWriter

java.lang.Object
  extended by org.jaudiotagger.audio.generic.AudioFileWriter
      extended by org.jaudiotagger.audio.mp3.MP3FileWriter

public class MP3FileWriter
extends AudioFileWriter

Write Mp3 Info (retrofitted to entagged ,done differently to entagged which is why some methods throw RuntimeException) because done elsewhere


Field Summary
 
Fields inherited from class org.jaudiotagger.audio.generic.AudioFileWriter
logger
 
Constructor Summary
MP3FileWriter()
           
 
Method Summary
 void delete(AudioFile af)
          Delete the Id3v1 and ID3v2 tags from file
 void deleteTag(AudioFile f)
           
protected  void deleteTag(java.io.RandomAccessFile raf, java.io.RandomAccessFile tempRaf)
          Same as above, but delete tag in the file.
 void writeFile(AudioFile f)
           
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, setAudioFileModificationListener, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MP3FileWriter

public MP3FileWriter()
Method Detail

deleteTag

public void deleteTag(AudioFile f)
               throws CannotWriteException
Throws:
CannotWriteException

writeFile

public void writeFile(AudioFile f)
               throws CannotWriteException
Throws:
CannotWriteException

delete

public void delete(AudioFile af)
            throws CannotReadException,
                   CannotWriteException
Delete the Id3v1 and ID3v2 tags from file

Overrides:
delete in class AudioFileWriter
Parameters:
af -
Throws:
CannotReadException
CannotWriteException

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 tempRaf)
                  throws CannotWriteException,
                         java.io.IOException
Description copied from class: AudioFileWriter
Same as above, but delete tag in the file.

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