I don't think this existed in the previous versions.
What happens?
When I try to change the ID3 tags on a file, i get an
Array out of bounds exception with this:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at helliker.id3.ID3v1Tag.getBytes
(ID3v1Tag.java:240)
at helliker.id3.ID3v1Tag.writeTag
(ID3v1Tag.java:208)
at helliker.id3.MP3File.writeTags
(MP3File.java:439)
I was not too happy with this so I investigated and I
found this line:
System.arraycopy( comment.getBytes(), 0, tag,
bytesCopied, comment.length());
Ok, everything is great with that line, then why is it
messing up. This is why.
I think size of the tag is : 128
bytesCopied by now was: 97
coment length was: 47
97+47 = 144, which is not good because all we have is
128 bytes.
so what did i do?
the following:
int copySize = ((tag.length - bytesCopied) >
comment.length() ? comment.length() : (tag.length -
bytesCopied));
System.arraycopy( comment.getBytes(), 0, tag,
bytesCopied, copySize);
It seems to work. Atleast it worked for me.
Logged In: YES
user_id=661657
It looks like v2 has same kind of problem?:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at helliker.id3.ID3v2Tag.getBytes(ID3v2Tag.java:369)
at helliker.id3.ID3v2Tag.writeTag(ID3v2Tag.java:270)