/**
* @param strUrl
* @param finleName
* **/
public static void downImgFromUrl(String strUrl,String fileName){
URL url=null;
InputStream in=null;
OutputStream out=null;
try {
url=new URL(strUrl);
if(url != null){
in=url.openStream();
}
File file=new File(fileName);
if(file != null){
out=new FileOutputStream(file);
byte[]bs=new byte[1024];
int byteread=0;
while((byteread=in.read(bs, 0, 1024))!=-1){
out.write(bs,0,byteread);
}
}
} catch (MalformedURLException e) {
//e.printStackTrace();
} catch (IOException e) {
//.printStackTrace();
}
finally{
try {
if(in != null){
in.close();
}
if(out != null){
out.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
String s = "http://192.168.1.111/image/xxx/xxx/1375386333640.jpg";
ImageUtils.downImgFromUrl(s, "h://_test/test.jpg");