摘要:
字节流数组读入 建立字节流读取,参数为字节数组读入流 InputStream bi = new BufferedInputStream(new ByteArrayInputStream(c)); 建立读取字节数组,数组长度变量len int len = 0; byte[] flush = new b 阅读全文
posted @ 2020-01-28 21:17
shimeath
阅读(120)
评论(0)
推荐(0)
摘要:
乱码问题 从文件中读取出现乱码主要有以下两个原因: 编码字符集不统一 截取长度不不够 解决方法 将文件以字节流读入,转换为字符流操作 字节流读入 --InputStreamReader–> 字符缓冲流读入 字节流写出 --OutputStreamReader–> 字符缓冲流写出 new InputS 阅读全文
posted @ 2020-01-28 18:52
shimeath
阅读(413)
评论(0)
推荐(0)
摘要:
缓冲流——增强性能 字节流的缓冲流(均未增加新方法) BufferedInputStream BufferedOutputStream 字节符的缓冲流 方法名称 方法作用 readLine() 返回值为String对象,读取一行 newLine() 换行符 字节流的缓冲流代码 package cn. 阅读全文
posted @ 2020-01-28 11:27
shimeath
阅读(156)
评论(0)
推荐(0)
摘要:
整体与字符流一致,详见字节流—输入输出、字节流—复制文件和文件夹 代码如下 字符流输入 package cn.hxh.io.charIO; import java.io.*; public class Demo01 { public static void main(String[] args) { 阅读全文
posted @ 2020-01-28 10:59
shimeath
阅读(264)
评论(0)
推荐(0)

浙公网安备 33010602011771号