AbstractOioByteChannel.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:netty-netty-5.0.0.Alpha1 作者:
@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)));
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号