public static void main(String[] args) { FileInputStream fis = null; DataInputStream dis=null; FileOutputStream fos=null; DataOutputStream dos=null; try { fis = new FileInputStream("D:\\qqqqqqq.jpg"); dis = new DataInputStream(fis); fos=new FileOutputStream("D:\\qqqqqqq.jpg"); dos=new DataOutputStream(fos); byte[] b=new byte[1024]; int len=0; while ((len=dis.read(b))!=-1){ dos.write(b,0,len); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { dos.close(); fos.close(); dis.close(); fis.close(); } catch (IOException e) { e.printStackTrace(); } } }
复制二进制文件(图片,视频)
最新推荐文章于 2024-11-03 11:01:20 发布