Questions tagged [deserialization]

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

7954 questions
2
votes
2 answers

Deserializing json data from jquery post method directly to string array

Is there a way to deserialize an array sent by jquery post method to directly c# string array(string[])? I tried posting data like this $.post(url, { 'selectedTeams[]'=['Team1','Team2'] }, function(response)…
Pawan Nogariya
  • 8,330
  • 12
  • 52
  • 105
2
votes
2 answers

xsd type="anySimpleType" for attribute

Apologies if this is a silly question, I haven't really done anything with xml up until now. I want to be able to deserialise some xml into a class that has a property of type object. This property could be an int, guid or a string. In the xml I…
ajbeaven
  • 9,265
  • 13
  • 76
  • 121
2
votes
1 answer

Best way to Serialize / Deserialize an image in Android

I'm trying to persist images in Android. I eventually settled on the creating a wrapper object to handle serialization. I expect that it is sub-optimal. My question: How could it be done better (especially with respect to performance and not…
diadyne
  • 4,038
  • 36
  • 28
2
votes
1 answer

How to map CSV records to a bean?

I'm looking for a Java library that can help me parse a CSV file containing pipe-delimited records and create instances of my bean class from them. I've looked into several alternatives such as SuperCSV, OpenCSV, BeanIO, JFileHelper, jsefa, ... but…
Jan Van den bosch
  • 3,542
  • 3
  • 26
  • 38
2
votes
4 answers

How can I deserialize an object if I don't know the right type?

Well I want to send commands and data between client and server. I have three projects: Client Server Common - here I put common classes and network abstraction layer I am using following data structures for communications between client and…
Neir0
  • 12,849
  • 28
  • 83
  • 139
2
votes
1 answer

Why is protobuf-net deserializer so much slower in my code than streamreading csv

I store simple time series in the following format and look for the fastest way to read and parse them to "quote" objects: DateTime, price1, price2 . . . DateTime is in the following string format: YYYYmmdd HH:mm:ss:fff price1 and price 2 are…
Matt
  • 7,004
  • 11
  • 71
  • 117
2
votes
2 answers

java gson replace password value while serialization

How can I replace the value of a password field with XXX while de-serializing an object with Gson? I found this post: Gson: How to exclude specific fields from Serialization without annotations that basically skips the field. This would be an…
kon
  • 3,732
  • 3
  • 26
  • 34
2
votes
1 answer

JSON.NET deserializing a multidimensional array?

I am passing (or well trying to!) a JSON object to my codebehind. This is the JSON object: [ { "testLaag":{ "layer_zindex":1, "layer_type":1, "layer_width":1, "layer_height":1, …
2
votes
1 answer

How to cast from char pointer to custom object pointer

I'm using leveldb to store key-value pairs of integer and MyClass objects. Actually, a key can contain more then one of theses objects. The problem I have appears when retrieving the data from the database. It compiles, however the values of the…
ezdazuzena
  • 6,120
  • 6
  • 41
  • 71
2
votes
2 answers

Serialize and Deserialize (C#)

How can deserialize one class to another class like this: var ser = SerializedObject(b);// read from Database! var des = DeSerializeAnObject(ser, typeof(BaseClass)); BaseClass baseclass = (BaseClass)des; baseclass.Hello();
2
votes
1 answer

Custom Deserialization in WCF Rest

I'm writing a WCF REST service and trying to use the ideas in Carlos Figueira's blog post here to customize my deserialization. There's just one problem. I'd like my custom IDispatchMessageFormatter.DeserializeRequest() to both: Deserialize the…
G S
  • 35,511
  • 22
  • 84
  • 118
2
votes
1 answer

Java SOAP XML Serialization Error

I have a .net server hosting some webservices. I am making a Java client. I used Apache CFX to autocreate some useful classes based on the given wsdl file. However, when I make the call in Java to the webservice I get the following error: Exception…
rustybeanstalk
  • 2,722
  • 9
  • 37
  • 57
2
votes
2 answers

How can I reconstruct the object hiearchy/references after XML deserialization in C#

I'm building a game project where there are simple container objects that can have children. I somehow need to save the "state" of the game and serializa to XML. Then I will simply be loading the game back by serializing XML, but I need to save the…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
2
votes
1 answer

Deserialization Error

I'm getting an error when trying to deserialize some data into a class. The error is: "System.RuntimeType is inaccessible due to its protection level. Only public types can be processed." The error and all the other searches I've done say that…
Dan Wager
  • 35
  • 5
2
votes
1 answer

How to serialize / deserialize a double value independent of culture

How can I serialize / deserialize a double value so that it can be read and written on systems with different decimal point symbols? Write: double d; d.ToString(); Read: double d = (double)Convert.ChangeType(serialized_value, new…
Markus Johansson
  • 3,733
  • 8
  • 36
  • 55