Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

MessagePack Java 0.6.X does not use annotations (annotations) to serialize

Shulou Source: shulou.com Published: 2022-06-03 07:03:20 11月23日 Update

If you can't add @ Message to your definition object but you still want to serialize it. You can use the register method to enable serialized objects in the class.

The following code is shown:

MessagePack msgpack = new MessagePack (); msgpack.register (MyMessage2.class)

For example, if the MyMessage2 class is included in an external library. You can't easily edit the source code by adding @ Message to the source code.

The register method allows for the automatic creation of a serializer and deserializer pair for MyMessage2.

You can serialize the object MyMessage2 after executing the aspect.

Https://www.cwiki.us/display/Serialization/QuickStart+For+MessagePack+Java+0.6.X

Tags: Sequences objects methods source code code methods aspects packages or annotations Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Linux Docker Shulou Tech Info MySQL