// File Name : Sample01.java
// Make File : abc.txt
public class Sample01
{
public static void main (String[] args)
{
// Write File
File file = new File("C:\\Users\\RyuDongYup\\workspace\\JavaSample03\\abc.txt");
try
{
FileOutputStream fos = new FileOutputStream(FileDescriptor.out);
FileOutputStream fos1 = new FileOutputStream(file);
byte[] data = {66, 68, 70, 72, (byte)'!'}; // 파일에 입력할 텍스트
fos.write(data);
fos1.write(data);
}catch(FileNotFoundException fnfe)
{
System.out.println("파일을 못찾겠다.");
System.exit(1);
}catch(IOException io)
{
System.out.println("파일 입출력 에러!!");
System.exit(1);
}
System.out.println("실행끝...!");
}
}