How to serialize a non-serializable in Java?

前端 未结 5 1744
太阳男子
太阳男子 2020-11-27 19:54

How can I serialize an object that does not implement Serializable? I cannot mark it Serializable because the class is from a 3rd party library.

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 20:37

    You can use Kryo. It works on non serialized classes but classes needs registered aforehand.

提交回复
热议问题