class MySQLBinlogEventPacketDecoder extends ByteToMessageDecoder {

    @Override
    protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) {
        MySQLPacketPayload payload = new MySQLPacketPayload(in);
        skipSequenceId(payload);
        checkError(payload);
        MySQLBinlogEventHeader binlogEventHeader = new MySQLBinlogEventHeader(payload);
        removeChecksum(binlogEventHeader.getEventType(), in);
        switch (MySQLBinlogEventType.valueOf(binlogEventHeader.getEventType())) {
            case ROTATE_EVENT:
                decodeRotateEvent(binlogEventHeader, payload);
                break;
            case FORMAT_DESCRIPTION_EVENT:
                new MySQLBinlogFormatDescriptionEventPacket(binlogEventHeader, payload);
                break;
            case TABLE_MAP_EVENT:
                decodeTableMapEvent(binlogEventHeader, payload);
                break;
            case WRITE_ROWS_EVENTv1:
            case WRITE_ROWS_EVENTv2:
                out.add(decodeWriteRowsEventV2(binlogEventHeader, payload));
                break;
            case UPDATE_ROWS_EVENTv1:
            case UPDATE_ROWS_EVENTv2:
                out.add(decodeUpdateRowsEventV2(binlogEventHeader, payload));
                break;
            case DELETE_ROWS_EVENTv1:
            case DELETE_ROWS_EVENTv2:
                out.add(decodeDeleteRowsEventV2(binlogEventHeader, payload));
                break;
            default:
                out.add(createPlaceholderEvent(binlogEventHeader));
                payload.skipReserved(payload.getByteBuf().readableBytes());
        }
        if (in.isReadable()) {
            throw new UnsupportedOperationException(String.format("Do not parse binlog event fully, eventHeader: %s, remaining packet %s", binlogEventHeader, readRemainPacket(payload)));
        }
    }

    public  MySQLBinlogEventPacketDecoder(final int checksumLength);

}