我的代码看起来像这样:
ByteBuf payload = Unpooled.buffer();
payload.writeByte(...);
...
ByteBuf fullMessage = Unpooled.buffer();
fullMessage.writeByte(...); // header
fullMessage.writeBytes(payload);
channel.writeAndFlush(fullMessage);
据我了解,在这种情况下我需要两个尝试catch块,对吗?还有更好的办法吗?