if (msg.isFinalFragment()) {
out.add(msg.retain());
return;
}
ByteBuf buf = ctx.alloc().compositeBuffer().addComponent(msg.content().retain());
buf.writerIndex(buf.writerIndex() + msg.content().readableBytes());
if (msg instanceof TextWebSocketFrame) {
currentFrame = new TextWebSocketFrame(true, msg.rsv(), buf);
} else if (msg instanceof BinaryWebSocketFrame) {
currentFrame = new BinaryWebSocketFrame(true, msg.rsv(), buf);