class Kryo5Cache {
        final Output output;
        final Kryo kryo;
        public Kryo5Cache(){
            kryo = new Kryo();
            kryo.setDefaultSerializer(CompatibleFieldSerializer.class);
            kryo.setRegistrationRequired(false);
            output = new Output(INIT_BUFFER_SIZE, -1);
        }

        public Output getOutput(){
            return output;
        }

        public Kryo getKryo(){
            return kryo;
        }

    }

    public Kryo5ValueEncoder(boolean useIdentityNumber) {
        super(useIdentityNumber);
    }

    @Override
    public byte[] apply(Object value) {<FILL_FUNCTION_BODY>

        Kryo5Cache kryoCache = null;
        try {
            kryoCache = kryoCacheObjectPool.borrowObject();
            if (useIdentityNumber) {
                writeInt(kryoCache.getOutput(), SerialPolicy.IDENTITY_NUMBER_KRYO5);
            }
            kryoCache.getKryo().writeClassAndObject(kryoCache.getOutput(), value);
            return kryoCache.getOutput().toBytes();
        } catch (Exception e) {
            StringBuilder sb = new StringBuilder("Kryo Encode error. ");
            sb.append("msg=").append(e.getMessage());
            throw new CacheEncodeException(sb.toString(), e);
        } finally {
            if (kryoCache != null) {
                kryoCacheObjectPool.returnObject(kryoCache);
            }
        }
    
<methods>public void <init>(boolean) ,public boolean isUseIdentityNumber() <variables>protected boolean useIdentityNumber