StupidBeauty
Read times:796Posted at:Fri Nov 22 18:18:25 2013
- no title specified

转载:HttpClient和JDK的HttpURLConnection抓取网络图片以及图片的重命名

使用HttpURLConnection可下载二进制数据。

http://jilongliang.iteye.com/blog/1969146

亮点

InputStream inStream=null;

/**

* 方法一

URL url = new URL(strUrl);

HttpURLConnection conn = (HttpURLConnection)url.openConnection();

conn.setRequestMethod("GET");

conn.setConnectTimeout(5 * 1000);

inStream = conn.getInputStream();//通过输入流获取图片数据

byte[] btImg = readStream(inStream);//得到图片的二进制数据

return btImg;

未知美人

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands