- 문자 입출력 스트림에 버퍼링을 제공
================================================================================================
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
public class BufferedReaderWriterTest {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader(args[0]));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(args[1])));
String s , s2 = new String();
while( (s = in.readLine()) != null){
out.write(s);
}
in.close();
out.close();
System.out.println(" Copied...Successfly!");
}
}
'프로그래밍 정리 > 자바' 카테고리의 다른 글
PrintWriter (0) | 2013.06.02 |
---|---|
LineNumberReader (0) | 2013.06.02 |
FileReader와 FileWriter (0) | 2013.06.02 |
InputStreamReader와 OutputStreamWriter (0) | 2013.06.01 |
ByteArrayInputStream와 ByteArrayOutputStream (0) | 2013.06.01 |