copyInputStreamToOutputStream(in, System.out)
本问题已经有最佳答案,请猛点这里访问。
我已经阅读了Android提供的HTTPS和SSL文档的安全性。我看到它一直在使用
江户十一〔一〕号
下面是有问题的代码:
1 2 3 4 | URL url = new URL("https://wikipedia.org"); URLConnection urlConnection = url.openConnection(); InputStream in = urlConnection.getInputStream(); copyInputStreamToOutputStream(in, System.out); |
将Java输入流的内容写入输出流的简单方法
org.apache.commons.io.IOUtils from Apache has a method called
copy(InputStream,OutputStream) which does exactly what you're looking
for.IOUtils.copy(in,out);
号