Questions tagged [deserialization]

Deserialization is the process by which an object is recreated from its serialized state.

7954 questions
2
votes
1 answer

Dynamic JAXB XML Deserialization (Unmarshalling)

I want to deserialize (unmarshal) simple POJOs directly from an XML string, without any configuration (schema definition or other) file. My application uses a simple base abstract class Field as follows: public abstract class Field { private…
PNS
  • 19,295
  • 32
  • 96
  • 143
2
votes
2 answers

Deserialize JSON with Gson in an object

I have a JSON string such as below. That comes from a Website (the URL outputs below to a page) which I'm using in an android application. {"posts": [{"id":"0000001","longitude":"50.722","latitude":"-1.87817","position":"Someplace…
Dev
  • 781
  • 9
  • 29
2
votes
1 answer

Serialize and Deserialize Oracle.DataAccess.OracleException in C#

OracleException has no public constructors nor any way to get a new instance. I tried my XmlSerializerHelper class, but it requires a public parameterless constructor. I used BinaryFormatter to serialize the OracleException and wrote it to a file. …
Kiquenet
  • 14,494
  • 35
  • 148
  • 243
2
votes
1 answer

How to deserialize JSON with GSON into corresponding generic Java types?

I want to deserialize a JSON object (using GSON, because I already use it for searializing objects) to a general Map of type Map. It should create Objects of types that do correspond to the according JSON types, i.e. this JSON…
Chagemei
  • 286
  • 6
  • 14
2
votes
2 answers

No Suitable Creator Method Found To Deserialize From JSON String

I use Jackson with my Spring application. When Jackson converts my JSON data to an object it gives me an error. My JSON data is that: {"name":"sdfg","username":"dfgdg","password":"dfgdg","type":"A","protocol":"1","description":"sdfsdfdsf"} My class…
kamaci
  • 72,915
  • 69
  • 228
  • 366
2
votes
0 answers
2
votes
3 answers

How to deserialize Excel file to 2-dimensional array?

I have an Excel worksheet where all the fields are strings. I would like to de-serialize all the data from the excel file to a 2D array (matrix). Any ideas how I can get started?
MoShe
  • 6,197
  • 17
  • 51
  • 77
2
votes
1 answer

Issues deserializing a JSON response from an API call. .NET 6

using System.Net.Http.Headers; using static System.Math; using System.Text.Json; using System.Text.Json.Serialization; using System.Net.Http.Json; using System.Net; using HttpClient client = new(); await ProcessRepositoriesAsync(client); static…
Chris
  • 23
  • 4
2
votes
1 answer

System.Text.Json: How to deserialize class with interface properties (.NET 6)

I'm currently in the process of migrating vom Newtonsoft to System.Text.Json. Newtonsoft was able to automatically deserialize objects, that have one or more Interface properties. With System.Text.Json I get the following error message for the…
Steve
  • 23
  • 2
2
votes
1 answer

How can we deserialize to ProtoBuf from huge json using JsonSerializer.DeserializeAsyncEnumerable with different property name

I have huge json file so I used below code and actually it works. using (FileStream? fileStream = new FileStream("hugefile.json", FileMode.Open)) { IAsyncEnumerable people =…
2
votes
1 answer

Is there a reason why Spring MVC doesn't apply a limit to the maximum number of bytes to buffer in memory for input stream like WebFlux?

For the first time I noticed this error in my Spring WebFlux application: org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144 So WebFlux has a limit that it checks while deserializing client…
SGiux
  • 619
  • 3
  • 10
  • 34
2
votes
5 answers

C# deserialize KeyValuePair from JSON

This is the absolute simplest version of this question (a subset of it). using System; using System.Collections.Generic; using System.Text.Json; public class Program { public class Subscription { public bool HasRead { get; set; } =…
jeancallisti
  • 1,046
  • 1
  • 11
  • 21
2
votes
2 answers

C# Deserialization - Is it safe to catch TargetInvocationException?

I am using BinaryFormatter to serialize and deserialize some objects. The structure of those object is as follows: [Serializable()] public class SerializableObject : ISerializable { public void GetObjectData(SerializationInfo info,…
Maja Remic
  • 399
  • 2
  • 7
2
votes
1 answer

Why fields are visited more than once when deserialization?

I am running serde_test, testing against the example from official documentation: https://serde.rs/deserialize-struct.html. All the code is identical except that the fn main() is mine. My goal is to check that visit_map is being called in a manner…
absuu
  • 340
  • 1
  • 11
2
votes
0 answers

Kotlin delegated property deserialization with Jackson

I am trying to deserialize a data class the built from a delegated property. Here is a quick snippet to reproduce my case : @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION, defaultImpl = BaseResponseDto::class) interface ResponseDto { val name:…