In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
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!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.