标题: 关于DataInputStream读取数据的问题 [打印本页] 作者: 罗闯 时间: 2012-4-12 20:42 标题: 关于DataInputStream读取数据的问题 public class StreamTest6 {
public static void main(String[] args) throws Exception{
DataOutputStream data = new DataOutputStream(new BufferedOutputStream(
new FileOutputStream("d.txt")));
char a ='d';
int b =9;
float d= 3.3f;
data.write(a);
data.write(b);
data.writeFloat(d);
data.close();
DataInputStream data2 = new DataInputStream(new BufferedInputStream
(new FileInputStream("d.txt")));