class MySQLBinlogEventPacketDecoder extends ByteToMessageDecoder {

    @Override
    protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out) {
        checkError(in);
        BinlogEventHeader binlogEventHeader = new BinlogEventHeader();
        binlogEventHeader.fromBytes(in);
        removeChecksum(binlogEventHeader.getTypeCode(), in);
        switch (binlogEventHeader.getTypeCode()) {
            case EventTypes.ROTATE_EVENT:
                decodeRotateEvent(in);
                break;
            case EventTypes.FORMAT_DESCRIPTION_EVENT:
                decodeFormatDescriptionEvent(in);
                break;
            case EventTypes.TABLE_MAP_EVENT:
                decodeTableMapEvent(in);
                break;
            case EventTypes.WRITE_ROWS_EVENT_V1:
            case EventTypes.WRITE_ROWS_EVENT_V2:
                out.add(decodeWriteRowsEventV2(binlogEventHeader, in));
                break;
            case EventTypes.UPDATE_ROWS_EVENT_V1:
            case EventTypes.UPDATE_ROWS_EVENT_V2:
                out.add(decodeUpdateRowsEventV2(binlogEventHeader, in));
                break;
            case EventTypes.DELETE_ROWS_EVENT_V1:
            case EventTypes.DELETE_ROWS_EVENT_V2:
                out.add(decodeDeleteRowsEventV2(binlogEventHeader, in));
                break;
            default:
                out.add(createPlaceholderEvent(binlogEventHeader));
                DataTypesCodec.skipBytes(in.readableBytes(), in);
        }
        if (in.isReadable()) {
            throw new UnsupportedOperationException();
        }
    }

    public  MySQLBinlogEventPacketDecoder(final int checksumLength);

}