// Convert to dynamic buffer (this requires copy)
// XXX Tune this value: Increasing the initial capacity of the dynamic
// buffer might reduce the chance of additional memory copy.
ChannelBuffer frame = ChannelBuffers.dynamicBuffer(length + DataConstants.SIZE_INT);
frame.writeBytes(in, length + DataConstants.SIZE_INT);
frame.skipBytes(DataConstants.SIZE_INT);
Channels.fireMessageReceived(ctx, frame);
}
}
private void append(final ChannelBuffer in, final int length)