if ("udp".equalsIgnoreCase(protocol)) {
encoders.add(ChannelHandlerFactories.newDatagramPacketEncoder());
}
// are we textline or object?
if (isTextline()) {
Charset charset = getEncoding() != null ? Charset.forName(getEncoding()) : CharsetUtil.UTF_8;
encoders.add(ChannelHandlerFactories.newStringEncoder(charset, protocol));
ByteBuf[] delimiters = delimiter == TextLineDelimiter.LINE ? Delimiters.lineDelimiter() : Delimiters.nulDelimiter();
decoders.add(ChannelHandlerFactories.newDelimiterBasedFrameDecoder(decoderMaxLineLength, delimiters, protocol));
decoders.add(ChannelHandlerFactories.newStringDecoder(charset, protocol));