Posted on 2006-11-12 23:14
苑 阅读(364)
评论(0) 编辑 收藏 所属分类:
java基础学习系列
import
java.io.BufferedOutputStream;
import
java.io.FileOutputStream;
public class
MainClass
{
public static
void
main
(
String args
[]) {
try
{
FileOutputStream fos =
new
FileOutputStream
("fileName"
)
;
BufferedOutputStream bos =
new
BufferedOutputStream
(
fos
)
;
for
(
int
i =
0
; i <
12
; i++
) {
bos.write
(
i
)
;
}
bos.close
()
;
}
catch
(
Exception e
) {
System.out.println
(
"Exception: "
+ e
)
;
}
}
}