「java」BufferedReaderと BufferedIutputStreamでファイルを読み込む、コピー操作コード
// ファイルを読み込む
BufferedReader is = new BufferedReader(new FileReader(“orgFile.txt"));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(“bytes.bat"));
is.close();
bos.close();
// ファイルをコピー
BufferedIutputStream is = new BufferedIutputStream(new FileIutputStream(“oldFileInfo.txt"));
BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(“newFileInfo.txt"));
int g;
while ((g = is.read()) != -1) {
os.write(g);
}
is.close();
os.close();