static public void main(String[] args){ File file=new File("C:\\ceshi2\\ceshi.pdf"); File file2=new File("C:\\ceshi2\\123.pdf"); try { InputStream InputStream=new FileInputStream(file); OutputStream outputStream=new FileOutputStream(file2); int bit; while((bit=InputStream.read())!=-1){ System.out.println(bit); outputStream.write(bit); } InputStream.close(); outputStream.close(); } catch (IOException e) { e.printStackTrace(); } }
标签:outputStream,二进制,写入,InputStream,File,new,pdf,bit From: https://www.cnblogs.com/cocotun/p/17279475.html