public T deserialize()

in client/src/main/java/org/apache/rocketmq/schema/registry/client/serde/avro/ReflectionAvroDeserializer.java [47:62]


    public T deserialize(String subject, byte[] bytes) {
        if (null == bytes) return null;

        if (null == type) {
            throw new SerializationException("deserialize type can not be null");
        }
        Schema schema = ReflectData.get().getSchema(type);
        try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes)) {
            BinaryDecoder decoder = DecoderFactory.get().binaryDecoder(bais, null);
            DatumReader<T> datumReader = new ReflectDatumReader<>(schema);
            T record = datumReader.read(null, decoder);
            return record;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }