采用imdecode函数
String strUrl = "http://...;
InputStream is = null;
ByteArrayOutputStream os = new ByteArrayOutputStream();
URL url = null;
try{
url = new URL(strUrl);
}catch (MalformedURLException e1){
e1.getMessage();
return -1;
}
try{
is = url.openStream();
}catch (IOException e2){
e2.getMessage();
return -1;
}
byte[] buffer = new byte[8192];
try {
int bytesRead = 0;
while((bytesRead = is.read(buffer,0,8192))!=-1){
os.write(buffer,0,bytesRead);
}
}catch (IOException e3){
e3.getMessage();
return -1;
}
try {
is.close();
}catch (IOException e4){
e4.getMessage();
return -1;
}