public static ChannelHandlerFactory newDelimiterBasedFrameDecoder(final int maxFrameLength, final ByteBuf[] delimiters, String protocol) { return newDelimiterBasedFrameDecoder(maxFrameLength, delimiters, true, protocol); }
if (isAllowDefaultCodec()) { if ("udp".equalsIgnoreCase(protocol)) { encoders.add(ChannelHandlerFactories.newDatagramPacketEncoder()); 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)); encoders.add(ChannelHandlerFactories.newByteArrayEncoder(protocol)); decoders.add(ChannelHandlerFactories.newByteArrayDecoder(protocol)); } else { encoders.add(ChannelHandlerFactories.newObjectEncoder(protocol)); decoders.add(ChannelHandlerFactories.newObjectDecoder(protocol)); decoders.add(ChannelHandlerFactories.newDatagramPacketDecoder());