基本网络编程概述.ppt

public static void main(String[] args) throws Exception { OutputStream out = new FileOutputStream(test.txt); out.write(hello.getBytes()); out.flush(); out.close(); } public static void main(String[] args) throws Exception { OutputStream out = new FileOutputStream(test.txt,true); byte[] bys = hello.getBytes(); for (int i = 0; i bys.length; i++) { out.write(bys[i]);//每次只写入一个内容 } out.flush(); out.close(); } OutputStreamTest.java int available() throws IOException:文件大小 abstract void close() throws IOException:关闭流 int read() throws IOException:从输入流中读取单个字节。 int read(byte[

文档评论(0)

1亿VIP精品文档

相关文档