JAVA언어 File 전송, io 천상의날개 2012. 6. 28. 20:33 파일전송 FileInputStream fis = null; try { File file = new File(filePath+fileName); fis = new FileInputStream(file); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } byte[] buffer = new byte[1024]; BufferedInputStream bis = new BufferedInputStream(fis); BufferedOutputStream bos=new BufferedOutputStream(os); int i; int offset = 0; while ((i = bis.read(buffer)) != -1) { bos.write(buffer, 0, i); offset+= i; } bos.flush(); os.close();