ChunkRemover.javaAPI DocJaudiotagger 2.0.41988Wed Mar 30 16:11:50 BST


public class ChunkRemover extends Object implements ChunkModifier
This {@link ChunkModifier} implementation is meant to remove selected chunks.
Christian Laireiter

Fields Summary
private final Set
Stores the GUIDs, which are about to be removed by this modifier.
Constructors Summary
public ChunkRemover( guids)
Creates an instance, for removing selected chunks.

guids the GUIDs which are about to be removed by this modifier.

        this.toRemove = new HashSet<GUID>();
        for (final GUID current : guids) {
Methods Summary
public booleanisApplicable( guid)

        return this.toRemove.contains(guid);
public ModificationResultmodify( guid, source, destination)

        ModificationResult result;
        if (guid == null) {
            // Now a chunk should be added, however, this implementation is for
            // removal.
            result = new ModificationResult(0, 0);
        } else {
            assert isApplicable(guid);
            // skip the chunk length minus 24 bytes for the already read length
            // and the guid.
            final long chunkLen = Utils.readUINT64(source);
            source.skip(chunkLen - 24);
            result = new ModificationResult(-1, -1 * chunkLen, guid);
        return result;