private void readObject()

in flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/common/schema/PulsarSchema.java [163:195]


    private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
        // Name
        String name = ois.readUTF();

        // Schema
        int byteLen = ois.readInt();
        byte[] schemaBytes = new byte[byteLen];
        ois.readFully(schemaBytes);

        // Type
        int typeIdx = ois.readInt();
        SchemaType type = SchemaType.valueOf(typeIdx);

        // Properties
        int propSize = ois.readInt();
        Map<String, String> properties = new HashMap<>(propSize);
        for (int i = 0; i < propSize; i++) {
            properties.put(ois.readUTF(), ois.readUTF());
        }

        // Timestamp
        long timestamp = ois.readLong();

        this.schemaInfo =
                SchemaInfoImpl.builder()
                        .name(name)
                        .schema(schemaBytes)
                        .type(type)
                        .properties(properties)
                        .timestamp(timestamp)
                        .build();
        this.schema = createSchema(schemaInfo);
    }