false as this has performance impacts.
+----------------+
| "HELLO, WORLD" |
+----------------+
into the following:
+--------+----------------+
+ 0x000C | "HELLO, WORLD" |
+--------+----------------+
If you turned on the {@code lengthIncludesLengthFieldLength} flag in the
constructor, the encoded data would look like the following
(12 (original data) + 2 (prepended data) = 14 (0xE)):
+--------+----------------+
+ 0x000E | "HELLO, WORLD" |
+--------+----------------+
{@link ChannelPipeline} pipeline = ...;
// Decoders
pipeline.addLast("frameDecoder", new {@link LineBasedFrameDecoder}(80));
pipeline.addLast("stringDecoder", new {@link StringDecoder}(CharsetUtil.UTF_8));
// Encoder
pipeline.addLast("stringEncoder", new {@link StringEncoder}(CharsetUtil.UTF_8));
and then you can use a {@link String} instead of a {@link ByteBuf}
as a message:
void channelRead({@link ChannelHandlerContext} ctx, {@link String} msg) {
ch.write("Did you say '" + msg + "'?\n");
}