try { String picUrl = "" URL url = new URL(picUrl); URLConnection conn = url.openConnection(); conn.setReadTimeout(5 * 1000); InputStream in = new BufferedInputStream(conn.getInputStream()); byte[] array = new byte[in.available()]; in.read(array); } catch (IOException e) { e.printStackTrace(); }finally { in.close(); }
java根据url读取文件流
最新推荐文章于 2024-05-25 10:57:37 发布