import java.io.*


//生成代表输入流的对象
fis=new FileInputStream("e:/src/from.txt")
//生成代表输出流的对象
fos=new FileOutputStream("e:/src/to.txt")
//生成一个字节数组
byte [] buffer = new byte[1024]

//当读取的文件为空值时,read方法返回值为-1
int temp=fis.read(buffer,0,buffer.length)

fos.write(buffer,0,temp)

 

相关文章:

  • 2021-09-14
  • 2021-05-15
  • 2022-01-01
  • 2021-08-11
  • 2021-08-06
  • 2021-08-14
  • 2021-10-03
  • 2021-12-14
猜你喜欢
  • 2021-12-12
  • 2021-11-28
  • 2021-12-29
  • 2021-05-14
  • 2021-09-30
  • 2022-12-23
相关资源
相似解决方案