![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
NIO
走一步-再走一步
这个作者很懒,什么都没留下…
展开
-
NIO超过1亿个字符解析
遇到一个json 文件,文件只有一行,里面内容是json 数组的形式,形如:[{"CreateTime":"2021-04-27T10:02:38.243","UpdateTime":null,"SupplierCode":"xxx","SupplierName":"xxxx","HotelId":"xxxxx","RoomCode":"xxxx"},{"CreateTime":"2021-04-27T10:02:38.243","UpdateTime":null,"SupplierCode":"xxx原创 2021-04-30 16:27:51 · 159 阅读 · 1 评论 -
NIO解决中文乱码
如果采取指定长度巧合分割了一个中文,造成读取中文乱码,解决方法如下:方式一:只保存读取正确的中文,从读取流中设置读取被分割的字符代码如下,采用clearprivate static StringBuilder readFromFile(String filePath) throws IOException { FileChannel fileChannel = FileChannel.open(Paths.get(filePath), StandardOpenOption.READ);原创 2021-02-05 13:31:10 · 515 阅读 · 0 评论