package FileOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
public class FileOutputStreamjicao {
public static void main(String[] args) throws IOException {
File file = new File("a.txt");
FileOutputStream fos=new FileOutputStream(file);
// FileOutputStream fos1=new FileOutputStream("b.txt");
fos.write(-27);
fos.write(-107);
fos.write(-118);
fos.write(-27);
fos.write(-107);
fos.write(-118);
System.out.println(Arrays.toString("啊啊".getBytes()));
// fos.write("啊啊".getBytes());
/*fos.write("你好".getBytes(),0,3);
fos.write("\r\n".getBytes());
fos.write("java".getBytes());*/
/*for (int i = 0; i < 5; i++) {
fos.write("全世界妖精妖怪联合起来成为一家人".getBytes(),3,18);
fos.write("\r\n".getBytes());
}*/
fos.close();
}
}
|
|