@Test public void testDecode() throws Exception { EmbeddedChannel ch = new EmbeddedChannel( new DelimiterBasedFrameDecoder(8192, true, Delimiters.lineDelimiter())); ch.writeInbound(Unpooled.copiedBuffer("first\r\nsecond\nthird", CharsetUtil.US_ASCII)); ByteBuf buf = ch.readInbound(); assertEquals("first", buf.toString(CharsetUtil.US_ASCII)); ByteBuf buf2 = ch.readInbound(); assertEquals("second", buf2.toString(CharsetUtil.US_ASCII)); assertNull(ch.readInbound()); ch.finish(); ReferenceCountUtil.release(ch.readInbound()); buf.release(); buf2.release(); }
@Override protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { Object decoded = decode(ctx, in); if (decoded != null) { out.add(decoded); } }
DelimiterBasedFrameDecoder extends ByteToMessageDecoder { @Override protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { Object decoded = decode(ctx, in); if (decoded != null) { out.add(decoded); } } }
DelimiterBasedFrameDecoder extends ByteToMessageDecoder { @Override protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { Object decoded = decode(ctx, in); if (decoded != null) { out.add(decoded); } } DelimiterBasedFrameDecoder(int maxFrameLength, ByteBuf delimiter);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, ByteBuf delimiter);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, boolean failFast,
            ByteBuf delimiter);  DelimiterBasedFrameDecoder(int maxFrameLength, ByteBuf... delimiters);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, ByteBuf... delimiters);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, boolean failFast, ByteBuf... delimiters); }
DelimiterBasedFrameDecoder extends ByteToMessageDecoder { @Override protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { Object decoded = decode(ctx, in); if (decoded != null) { out.add(decoded); } } DelimiterBasedFrameDecoder(int maxFrameLength, ByteBuf delimiter);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, ByteBuf delimiter);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, boolean failFast,
            ByteBuf delimiter);  DelimiterBasedFrameDecoder(int maxFrameLength, ByteBuf... delimiters);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, ByteBuf... delimiters);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, boolean failFast, ByteBuf... delimiters);  }
DelimiterBasedFrameDecoder extends ByteToMessageDecoder { @Override protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { Object decoded = decode(ctx, in); if (decoded != null) { out.add(decoded); } } DelimiterBasedFrameDecoder(int maxFrameLength, ByteBuf delimiter);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, ByteBuf delimiter);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, boolean failFast,
            ByteBuf delimiter);  DelimiterBasedFrameDecoder(int maxFrameLength, ByteBuf... delimiters);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, ByteBuf... delimiters);  DelimiterBasedFrameDecoder(
            int maxFrameLength, boolean stripDelimiter, boolean failFast, ByteBuf... delimiters);   }