- 继承父类FilterInputStream
- 优点:可以读写基本数据
DataOutputStream bos = new DataOutputStream(new FileOutputStream("A.txt"));
bos.writeInt(13123);
bos.writeDouble(3.11);
bos.writeBoolean(true);
bos.writeByte('a');
bos.writeUTF("哈哈哈");
DataInputStream bis = new DataInputStream(new FileInputStream("A.txt"));
System.out.println(bis.readInt());
System.out.println(bis.readDouble());
System.out.println(bis.readBoolean());
System.out.println(bis.readByte());
System.out.println(bis.readUTF());
bis.close();
bos.close();