1) I replaced the function readTag with the function
below. Since asian characters are all double byted. Fix
byte length doesnt work for double byte characters.
private void readTag(RandomAccessFile raf)
throws FileNotFoundException, IOException {
raf.seek(raf.length() - TAG_SIZE);
byte[] buf = new byte[TAG_SIZE];
raf.read(buf, 0, TAG_SIZE);
String tag = new String(buf, 0, TAG_SIZE);
int start = TAG_START.length();
// title = chopSubstring(tag, start, start +=
TITLE_SIZE);
// artist = chopSubstring(tag, start, start +=
ARTIST_SIZE);
// album = chopSubstring(tag, start, start +=
ALBUM_SIZE);
// year = chopSubstring(tag, start, start +=
YEAR_SIZE);
// comment = chopSubstring(tag, start, start +=
COMMENT_SIZE);
StringTokenizer tokenizer = new StringTokenizer
(tag);
title = tokenizer.nextToken(String.valueOf('\0'));
artist = tokenizer.nextToken(String.valueOf('\0'));
album = tokenizer.nextToken(String.valueOf('\0'));
year = tokenizer.nextToken(String.valueOf('\0'));
comment = tokenizer.nextToken(String.valueOf
('\0'));
track = (int) (buf[TRACK_LOCATION] &
0xff); //reed - access genre ids > 127
genre = (int) (buf[GENRE_LOCATION] & 0xff);
}