IO
字节输出/输入流:OutPutStream / InputStream
字符输出/输入流: Writer / Reader
流必须要关闭
流读取的方法:
InputStream:
//循环优化一直读取
int len = 0;
while ((len=f.read())!=-1){
System.out.println((char)len);
}byte[] b = new byte[1024];int len = 0;
while ((len=f.read(b))!=-1){
System.out.println(new String(b,0,len));
}
Reader:
char[] b = new char[1024];
while ((len = fr.read(b))!=-1){
System.out.println(new String(b,0,len));
}
Propect集合的方法
store写入到硬盘中
load硬盘中的键值对,去到集合中
stringPropertyNames 获取 key
缓冲流 :
字节BufferOutPutStream / BufferInPutStream
字符 BufferWriter (newLine()新一行 ) / BufferReader
转换流:OutputStreamWriter/InputStreamReader编码格式必须一样
序列化:ObjectOutputStream/ObjectInputStream
transient修饰的不能被序列化
给序列化一个指定的序列化值:static final long serialVersionUID = 1l;=后面可以随便写
序列化的类 必须实现接口:Serializable
标签:IO,System,len,char,File,new,序列化,out From: https://www.cnblogs.com/songyuejava/p/16638758.html