@Override
    public LogEntry decode(final byte[] bs) {
        if (bs == null || bs.length < 1) {
            return null;
        }

        if (bs[0] == LogEntryV2CodecFactory.MAGIC_BYTES[0]) {
            return V2Decoder.INSTANCE.decode(bs);
        } else {
            return V1Decoder.INSTANCE.decode(bs);
        }
    }
Decoder that supports both v1 and v2 log entry codec protocol.
@author boyan(boyan@antfin.com)
jraft-core/src/main/java/com/alipay/sofa/jraft/entity/codec/AutoDetectDecoder.java