所以我要做的是将信息从file2复制到file1的开头。如果有人能帮助我,我会非常感谢你的时间,谢谢。
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
FileInputStream fileReader = new FileInputStream(reader.readLine()); //file1
FileOutputStream fileWriter = new FileOutputStream(reader.readLine(), true); //file2
while (fileReader.available() > 0) {
int data = fileReader.read();
fileWriter.write(data);
}
fileReader.close();
fileWriter.close();
reader.close();