Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the new features of Java's fastjson1.1.32

Shulou Source: shulou.com Published: 2022-06-02 09:09:04 09月24日 Update

This article mainly introduces "what are the new functions of fastjson1.1.32 in Java". In daily operation, I believe many people have doubts about the new functions of fastjson1.1.32 in Java. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "what are the new functions of fastjson1.1.32 in Java?" Next, please follow the editor to study!

Fastjson, the fastest json library in the java language, released version 1.1.32, which added stream api to support the processing of super-large json text.

Bug

[FASTJSON-208]-deserialize the non-setter collection property returns a null spatio-temporal pointer exception

[FASTJSON-209]-JSONField (serialize=false) configuration does not work on fields

[FASTJSON-211]-an error occurred while processing null by ThrowableDeserializer

Improvement

[FASTJSON-210]-supports streaming deserialization

[FASTJSON-212]-parser automatically recognizes more date formats

When you need to deal with oversized JSON text, you need Stream API, and you start providing Stream API in the fastjson-1.1.32 version.

# Serialization

# # case 1

JSONWriter writer = new JSONWriter (new FileWriter ("/ tmp/huge.json")); writer.startArray (); for (int I = 0; I < 1000 * 1000; + + I) {writer.writeValue (new VO ());} writer.endArray (); writer.close ()

# # case 2

JSONWriter writer = new JSONWriter (new FileWriter ("/ tmp/huge.json")); writer.startObject (); for (int I = 0; I < 1000 * 1000; + + I) {writer.writeKey ("x" + I); writer.writeValue (new VO ());} writer.endObject (); writer.close ()

# deserialization

# # case 3

JSONReader reader = new JSONReader (new FileReader ("/ tmp/huge.json")); reader.startArray (); while (reader.hasNext ()) {VO vo = reader.readObject (VO.class); / / handle vo...} reader.endArray (); reader.close ()

# # case 4

JSONReader reader = new JSONReader (new FileReader ("/ tmp/huge.json"))

Reader.startObject ()

While (reader.hasNext ()) {

String key = reader.readString ()

VO vo = reader.readObject (VO.class)

/ / handle vo...

}

Reader.endObject ()

Reader.close ()

At this point, the study on "what are the new functions of Java fastjson1.1.32" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: New features sequences learning more versions processing text help support practical fastest next functions fields properties pointers articles methods dates time and space Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno Docker Redmi vpn