private static long contentLength(Object msg) {
if (msg instanceof HttpContent) {
return ((HttpContent) msg).content().readableBytes();
}
if (msg instanceof ByteBuf) {
return ((ByteBuf) msg).readableBytes();
}
if (msg instanceof FileRegion) {
return ((FileRegion) msg).count();
}
throw new IllegalStateException("unexpected message type: " + StringUtil.simpleClassName(msg));
}
HttpObjectEncoder.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:netty4.0.27Learn
作者:
评论列表
文章目录