// For each run of the minimizer loop, this list stores
// the tags that can be removed without the input file
// crashing.
final List<Tag> removableTags = new ArrayList<Tag>();
final TagList tags = parsedFile.getTags();
int tagCounter = 1;
// Inner loop: Remove one tag at a time and then check
// whether the modified file still crashes.
for (final Tag tag : tags) {
System.out.printf("Trying to remove tag %s (%d of %d) at offset %08X ... ", TagNames.getPrintableTagName(tag.getHeader().getTagCode()), tagCounter, tags.size(), tag.getBitPosition() / 8);
final int startOffset = tag.getBitPosition() / 8;
final int length = tag.getHeader().getHeaderLength() + tag.getHeader().getNormalizedLength();
final byte[] modifiedData = ArrayHelpers.removeData(fileData, startOffset, length);