求这庐江县6p181张原图图

当前访客身份:游客 [
当前位置:
发布于 日 22时,
Android平台
代码片段(2)
1.&[代码]网络获取图片Application程序代码
结果在本地目录中存储为“captain.jpg”&&&&
package cn.captain.
import java.io.ByteArrayOutputS
import java.io.F
import java.io.FileOutputS
import java.io.InputS
import java.net.HttpURLC
import java.net.URL;
public class ImageRequest
* @param args
* @throws MalformedURLException
public static void main(String[] args) throws Exception
URL url = new URL("http://m4./car/120/95/90/Img.jpg");
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("GET");
conn.setConnectTimeout(5 * 1000);
InputStream inStream =
conn.getInputStream();//通过输入流获取图片数据
byte[] data = readInputStream(inStream);//得到图片的二进制数据
File ImageFile = new File("Captain.jpg");//存到本地硬盘名为“captain”
FileOutputStream
outstream = new FileOutputStream(ImageFile);
outstream.write(data);
outstream.close();
public static byte[] readInputStream(InputStream instream) throws Exception
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
buffer = new byte[1204];
int len = 0;
while ((len = instream.read(buffer)) != -1)
outStream.write(buffer,0,len);
instream.close();
return outStream.toByteArray();
2.&[图片] QQ截图04.png&&&&
开源中国-程序员在线工具:
&IT职业交流& ,诚邀加入! 和谐交流,谢谢
开源从代码分享开始
齐亮的其它代码The page is temporarily unavailable
nginx error!
The page you are looking for is temporarily unavailable.
Please try again later.
Website Administrator
Something has triggered an error on your
This is the default error page for
nginx that is distributed with
It is located
/usr/share/nginx/html/50x.html
You should customize this error page for your own
site or edit the error_page directive in
the nginx configuration file
/etc/nginx/nginx.conf.The page is temporarily unavailable
nginx error!
The page you are looking for is temporarily unavailable.
Please try again later.
Website Administrator
Something has triggered an error on your
This is the default error page for
nginx that is distributed with
It is located
/usr/share/nginx/html/50x.html
You should customize this error page for your own
site or edit the error_page directive in
the nginx configuration file
/etc/nginx/nginx.conf.

我要回帖

更多关于 张柏芝 照艳原图 种子 的文章

 

随机推荐