this.playlist = this.getPlaylist();
it = this.playlist.iterator();
continue;
}
LastFmTrack currentTrack = it.next();
// Read stream
BufferedInputStream is = null;
try {
URL trackUrl = new URL(currentTrack.getLocation());
URLConnection connection = trackUrl.openConnection();
is = new BufferedInputStream(connection.getInputStream());
byte[] buffer = new byte[2048];
int bytesRead = 0;
synchronized(this.listeners) {
for (LastFmListener listener : this.listeners) {
listener.startTrack(currentTrack.getCreator(), currentTrack.getTitle(), currentTrack.getAlbum());
}
}
while (!this.skipTrack && this.connected && (bytesRead = is.read(buffer)) > -1) {
byte[] currentData = new byte[bytesRead];