public abstract class AudioFileWriter extends Object
Modifier and Type | Field and Description |
---|---|
static Logger |
logger |
protected static int |
MINIMUM_FILESIZE |
Constructor and Description |
---|
AudioFileWriter() |
Modifier and Type | Method and Description |
---|---|
void |
delete(AudioFile af)
Delete the tag (if any) present in the given file
|
void |
delete(Tag tag,
RandomAccessFile raf,
RandomAccessFile tempRaf)
Delete the tag (if any) present in the given randomaccessfile, and do not
close it at the end.
|
protected abstract void |
deleteTag(Tag tag,
RandomAccessFile raf,
RandomAccessFile tempRaf)
Same as above, but delete tag in the file.
|
void |
setAudioFileModificationListener(AudioFileModificationListener listener)
This method sets the
AudioFileModificationListener .There is only one listener allowed, if you want more instances to be supported, use the ModificationHandler to broadcast those events. |
void |
write(AudioFile af)
Write the tag (if not empty) present in the AudioFile in the associated
File
|
protected abstract void |
writeTag(AudioFile audioFile,
Tag tag,
RandomAccessFile raf,
RandomAccessFile rafTemp)
This is called when a tag has to be written in a file.
|
protected static final int MINIMUM_FILESIZE
public static Logger logger
public void delete(AudioFile af) throws CannotReadException, CannotWriteException
af
- The file to processCannotWriteException
- if anything went wrongCannotReadException
public void delete(Tag tag, RandomAccessFile raf, RandomAccessFile tempRaf) throws CannotReadException, CannotWriteException, IOException
tag
- raf
- The source file, already opened in r-write modetempRaf
- The temporary file opened in r-write modeCannotWriteException
- if anything went wrongCannotReadException
IOException
protected abstract void deleteTag(Tag tag, RandomAccessFile raf, RandomAccessFile tempRaf) throws CannotReadException, CannotWriteException, IOException
tag
- raf
- tempRaf
- IOException
- is thrown when the RandomAccessFile operations throw it (you
should never throw them manually)CannotWriteException
- when an error occured during the deletion of the tagCannotReadException
public void setAudioFileModificationListener(AudioFileModificationListener listener)
AudioFileModificationListener
.ModificationHandler
to broadcast those events.listener
- The listener. null
allowed to deregister.public void write(AudioFile af) throws CannotWriteException
af
- The file we want to processCannotWriteException
- if anything went wrongprotected abstract void writeTag(AudioFile audioFile, Tag tag, RandomAccessFile raf, RandomAccessFile rafTemp) throws CannotReadException, CannotWriteException, IOException
audioFile
- tag
- raf
- rafTemp
- IOException
- is thrown when the RandomAccessFile operations throw it (you
should never throw them manually)CannotWriteException
- when an error occured during the generation of the tagCannotReadException
Copyright © 2005–2020 jthink.net. All rights reserved.