@Override
    protected void encode(ChannelHandlerContext ctx, CharSequence msg, List<Object> out) throws Exception {
        ByteBuf buffer = ByteBufUtil.encodeString(ctx.alloc(), CharBuffer.wrap(msg), charset, lineSeparator.length);
        buffer.writeBytes(lineSeparator);
        out.add(buffer);
    }
@Test
    public void testEncode() {
        testLineEncode(LineSeparator.DEFAULT, "abc");
        testLineEncode(LineSeparator.WINDOWS, "abc");
        testLineEncode(LineSeparator.UNIX, "abc");
    }