@Override
protected void doWrite(ChannelOutboundBuffer in) throws Exception {
for (;;) {
Object msg = in.current(false);
if (msg == null) {
// nothing left to write
break;
}
if (msg instanceof ByteBuf) {
ByteBuf buf = (ByteBuf) msg;
while (buf.isReadable()) {
doWriteBytes(buf);
}
in.remove();
} else if (msg instanceof FileRegion) {
doWriteFileRegion((FileRegion) msg);
in.remove();
} else {
in.remove(new UnsupportedOperationException(
"unsupported message type: " + StringUtil.simpleClassName(msg)));
}
}
}
AbstractOioByteChannel.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:netty-netty-5.0.0.Alpha1
作者:
评论列表
文章目录