URL url = new URL(""); try (InputStream input = url.openStream(); BufferedInputStream in = new BufferedInputStream(input); ServletOutputStream outputStream = response.getOutputStream(); BufferedOutputStream output = new BufferedOutputStream(outputStream)) { byte[] buffer = new byte[4096]; int n; while (-1 != (n = in.read(buffer))) { output.write(buffer, 0, n); } } catch (IOException e) { log.error("流转换异常", e); }
url 转 流
最新推荐文章于 2024-08-05 04:49:40 发布