final RealChunk cont = findContChunk(raf);
final DataInputStream dis = cont.getDataInputStream();
final String title = Utils.readString(dis, Utils.readUint16(dis));
final String author = Utils.readString(dis, Utils.readUint16(dis));
final String copyright = Utils.readString(dis, Utils.readUint16(dis));
final String comment = Utils.readString(dis, Utils.readUint16(dis));
final RealTag rv = new RealTag();
// NOTE: frequently these fields are off-by-one, thus the crazy
// logic below...
try
{
rv.addField(FieldKey.TITLE,(title.length() == 0 ? author : title));
rv.addField(FieldKey.ARTIST, title.length() == 0 ? copyright : author);
rv.addField(FieldKey.COMMENT,comment);
}
catch(FieldDataInvalidException fdie)
{
throw new RuntimeException(fdie);
}
return rv;