Is there any library to deserialize with python which is serialized with java

前端 未结 7 1401
野性不改
野性不改 2021-01-04 09:49

Is there any library to deserialize with python which is serialized with java?

7条回答
  •  梦毁少年i
    2021-01-04 10:31

    Java binary serialization is really designed to be used with Java. To do it in Python you'd have to have all the relevant Java classes available for inspection, and create Python objects appropriately - it would be pretty hideous and fragile.

    You're better off using a cross-platform serialization format such as Thrift, Protocol Buffers, JSON or XML. If you can't change which serialization format is used in the Java code, I'd suggest writing new Java code which deserializes from the binary format and then reserializes to a cross-platform format.

提交回复
热议问题