MessagePack Java Jackson Dataformat not use serialization str8 data types

Old msgpack-java (eg 0.6.7) does not support MessagePack str8 data types.

When you want your application needs to support older versions, you need to disable this type of data, for example, use the following statement:

MessagePack.PackerConfig config = new MessagePack.PackerConfig().withStr8FormatSupport(false);
ObjectMapper mapperWithConfig = new ObjectMapper(new MessagePackFactory(config));
// This string is serialized as bin8 type
byte[] resultWithoutStr8Format = mapperWithConfig.writeValueAsBytes(str8LengthString);

https://www.cwiki.us/display/Serialization/MessagePack+Jackson+Dataformat

Guess you like

Origin www.cnblogs.com/huyuchengus/p/11330460.html