org.jaudiotagger.audio.asf.io
Class ChunkRemover

java.lang.Object
  extended by org.jaudiotagger.audio.asf.io.ChunkRemover
All Implemented Interfaces:
ChunkModifier

public class ChunkRemover
extends java.lang.Object
implements ChunkModifier

This ChunkModifier implementation is meant to remove selected chunks.

Author:
Christian Laireiter

Field Summary
private  java.util.Set<GUID> toRemove
          Stores the GUIDs, which are about to be removed by this modifier.
 
Constructor Summary
ChunkRemover(GUID... guids)
          Creates an instance, for removing selected chunks.
 
Method Summary
 boolean isApplicable(GUID guid)
          Determines, whether the modifier handles chunks identified by given guid.
 ModificationResult modify(GUID guid, java.io.InputStream source, java.io.OutputStream destination)
          Writes a modified copy of the chunk into the destination..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toRemove

private final java.util.Set<GUID> toRemove
Stores the GUIDs, which are about to be removed by this modifier.

Constructor Detail

ChunkRemover

public ChunkRemover(GUID... guids)
Creates an instance, for removing selected chunks.

Parameters:
guids - the GUIDs which are about to be removed by this modifier.
Method Detail

isApplicable

public boolean isApplicable(GUID guid)
Determines, whether the modifier handles chunks identified by given guid.

Specified by:
isApplicable in interface ChunkModifier
Parameters:
guid - GUID to test.
Returns:
true, if this modifier can be used to modify the chunk.

modify

public ModificationResult modify(GUID guid,
                                 java.io.InputStream source,
                                 java.io.OutputStream destination)
                          throws java.io.IOException
Writes a modified copy of the chunk into the destination..

Specified by:
modify in interface ChunkModifier
Parameters:
guid - GUID of the chunk to modify.
source - a stream providing the chunk, starting at the chunks length field.
destination - destination for the modified chunk.
Returns:
the differences between source and destination.
Throws:
java.io.IOException - on I/O errors.