流 file://E:/java/%E5%B0%B1%E4%B8%9A%E7%8F%AD%E8%AF%BE%E7%A8%8B/%E5%B0%B1%E4%B8%9A%E7%8F%ADse/day09/%E7%AC%94%E8%AE%B0/img/IO%E5%B0%8F%E7%BB%93%E5%AD%97%E8%8A%82%E6%B5%81.jpg?lastModify=1557709251 file://E:/java/%E5%B0%B1%E4%B8%9A%E7%8F%AD%E8%AF%BE%E7%A8%8B/%E5%B0%B1%E4%B8%9A%E7%8F%ADse/day09/%E7%AC%94%E8%AE%B0/img/IO%E5%B0%8F%E7%BB%93%E5%AD%97%E7%AC%A6%E6%B5%81.jpg?lastModify=1557709251 编码:byte[] bytes = getBytes() getBytes("UTF-8") 解码: String ss = new String(bys[]) new String(bys[],"UTF-8") 字符流写数据 flush() 刷新流,之后还可以继续写数据 close() 关闭流,释放资源 字符流读数据 int read() 一次读一个字符数据 int read(char[] cbuf) 一次读一个字符数组数据
[输入流] 读数据
[输入流] 读数据
FileInputSteram fis = new FileInputSteram("路径")[字节流]
BufferedInputSteram bis = new BuffteredSteram(new FileInpouSteram("路径")); [字节缓冲流]
InputSteramReader isr = new InputSteramReader(new FileInputSteram("路径")); [字符流]
BufferedRerder br = new BufferedReader(new FileInputSteram("路径")); [字符缓冲流]
[输出流] 写数据[输出流] 写数据
FileOutputSteram fos = new FileOutputSteram("路径",true)[字节]
BufferedOutputSteram bos = new BufferedOutoutSteram(new FileOutputSteram("路径")); [字节缓冲流]
OutputSteramWriter osw = new OutputSteramWriter(new FileOutputSteram("路径")); [字符流]
BufferedWriter bw = new BufferedWriter(new FileOutputSteram("路径")); [字符缓冲流]
标准输入输出流标准输入流 |