import java.io.*;
public class ReadFile {
public static void main(String[] args) throws IOException {
File in = new File("in.txt");
//File out = new File("out.txt");
FileOutputStream fos= new FileOutputStream("o.txt");
//PrintWriter fw= new PrintWriter(out);
if(!in.exists())
{
in.createNewFile();
//System.out.println("Hey");
}
FileReader is = new FileReader(in);
BufferedReader br= new BufferedReader(is);
while(true)
{
if(in.canRead())
{
try {
System.out.println(br.readLine());
fos.write((br.readLine()).getBytes());
} catch (Exception e) {
// TODO Auto-generated catch block
fos.close();
br.close();
System.out.println("Im breaking");
break;
}
}
else
{
fos.close();
System.out.println("closed");
break;
)
}
}
}
//end of file
- 내가 Java.I에서 다른 파일 우리가 바이트로 바이트를 복사 할 수 있습니다 알고에 하나 개의 파일에서 텍스트를 복사하려고하지만, ! 뭐가 문제 야?
실제 파일 : 파일 복사 (전체 파일을 복사하기되지 않음) 내가 문자열을 사용하여 수행 할
출력 파일 :
'fos.write (br.readLine() + "\ n");'? – Charlie