JAVA 자바 웹에서 파일 다운 받는 초간단 예제. Real_G 2009. 9. 25. 18:39 반응형 try { URL u = new URL("test"); FileOutputStream fos = new FileOutputStream("out.dat"); InputStream is = u.openStream(); byte[] buf = new byte[1024]; int len = 0; while((len = is.read(buf)) > 0) { fos.write(buf,0,len); } fos.close(); is.close(); } catch (Exception e) { e.printStackTrace(); } 반응형 저작자표시 비영리 변경금지 (새창열림)