//切记以数据类型输出就以什么数据类型读入, //例如: dos.writeInt(100);写入,读取:dis.readUTF()有时会出现意想不到的错误,所以要时刻记得以数据类型输出就以什么数据类型读入 //DataInputStream(二进制输入流) public class DataInputStreamDemo { //二进制流(读操作) public static void main(String[] args) { FileInputStream fis = null; Data
文本IO 一.简述 OutputStreamWriter类使用选定的编码方式吧Unicode字符流转换为字节流,InputStreamReader类将包含字节的输入流转为可以产生Unicode字符的读入器. 例: (1)InputStreamReader in = new InputStreamReader(System.in)让一个输入读入器可以从控制台读入输入并转换为Unicode (2)InputStreamReader in = new InputStreamReader(new Fil
使用ConfigurationManager类 读写配置文件app.config,以下为代码: view plaincopy to clipboard print? using System; using System.Configuration; static class Program { static void Main() { showConfig(); UpdateAppSettings(); showConfig(); Console.ReadKey(true); } private