An encoder that prepends the length of the message. The length value is prepended as a binary form. It is encoded in either big endian or little endian depending on the default {@link ByteOrder} of the current{@link ChannelBufferFactory}.
For example, {@link LengthFieldPrepender}(2) will encode the following 12-bytes string:
+----------------+ | "HELLO, WORLD" | +----------------+
into the following:
+--------+----------------+ + 0x000C | "HELLO, WORLD" | +--------+----------------+
If you turned on the {@code lengthIncludesLengthFieldLength} flag in theconstructor, the encoded data would look like the following (12 (original data) + 2 (prepended data) = 14 (0xE)):
+--------+----------------+ + 0x000E | "HELLO, WORLD" | +--------+----------------+
@author The Netty Project (netty-dev@lists.jboss.org)
@author Trustin Lee (tlee@redhat.com)
@version $Rev: 1437 $, $Date: 2009-06-18 20:29:29 +0900 (Thu, 18 Jun 2009) $