URLConnection uc = url.openConnection();
InputStream is = uc.getInputStream();
OutputStream os = new FileOutputStream("d://b.mp3");
byte[] b =new byte[1024];
int len = 0;
while ((len = is.read(b)) != -1) {
os.write(b, 0, len);
os.flush();
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}