摘要: 1.字节流:InputStream和OutputStream是字节流的两个基类,分别定义了read()和write()方法。常用的几个子类,读写文件:FileInputStream和FileOutputStream,提供缓冲读写:BufferedInputStream和BufferedOutputStream,读写基本数据类型:DataInputStream和DataOutputStream,用于线程间通信:PipedInputStream和PipedOutputStream。2.字符流:Reader和Writer是字符流的两个基类,分别定义了read()和write()方法。常用的是提供缓冲 阅读全文
posted @ 2011-11-23 10:43 xiao秋 阅读(426) 评论(0) 推荐(1) 编辑
摘要: public class FileDemo { public static void main(String[] args) throws Exception { Student stu1 = new Student(1,"chichao"); Student stu2 = new Student(1,"caijing"); RandomAccessFile ref = new RandomAccessFile("D:"+File.separator+"test"+File.separator+"hell 阅读全文
posted @ 2011-11-23 10:28 xiao秋 阅读(446) 评论(0) 推荐(0) 编辑