DataStream_操作基本类型数据的流对象

 import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException; public class Test {
public static void main(String[] args) throws IOException {
writeData();
readData();
}
public static void readData() throws IOException { DataInputStream dis = new DataInputStream(new FileInputStream("F:\\IO\\data.txt")); String str = dis.readUTF(); System.out.println(str);
} public static void writeData() throws IOException { DataOutputStream dos = new DataOutputStream(new FileOutputStream("F:\\IO\\data.txt")); dos.writeUTF("你好"); dos.close();
}
}
上一篇:ThinkPHP缓存技术(S(),F(),查询缓存,静态缓存)


下一篇:iis最大工作进程数