public static void main(String[] args) throws IOException {
// 获取文件流
InputStream fis= new FileInputStream("D:\\桌面\\111\\111.txt");
int index;
byte[] bytes = new byte[1024];
FileOutputStream fos= new FileOutputStream("D:\\桌面\\111\\222.txt");
while ((index = fis.read(bytes)) != -1) {
fos.write(bytes, 0, index);
fos.flush();
}
fos.close();
fis.close();
}
网友评论