![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Nio
文章平均质量分 82
阿......嚏
Single hand that wipes tears during failures is much better than countless hands that come together to clap on success。
展开
-
IO流之Reader&Writer&缓冲流&转换流
字符流的由来:因为数据编码的不同,因而有了对字符进行高效操作的流对象,字符流本质其实就是基于字节流读取时,去查了指定的码表,而字节流直接读取数据会有乱码的问题(读中文会乱码)。从另一角度来说:字符流 = 字节流 + 编码表。package IO;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;public class CharaterStr原创 2022-03-03 17:09:39 · 530 阅读 · 0 评论 -
Netty心跳检测之IdleStateHandler
protected void initChannel(SocketChannel ch) throws Exception { // 初始化时,IdleStateHandler 加入到pipeline时,会初始化一个任务加入到队列中,并且记录当前时间微妙 // 线程遍历队列,当执行到的该IdleStateHandler对应的任务时,通过当前时间与过期时间比较,如果小于0说明超时,会调用ServerIdleStateTrigger // 执行相应的逻辑,比如断开客户端连接 ch.pipeli原创 2021-08-24 16:27:17 · 91 阅读 · 1 评论