Questions tagged [deserialization]

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

7954 questions
3
votes
1 answer

GSON with Scala - Unable to invoke no-args constructor for scala.collection.immutable.Map

Here is a sample Scala object in which I want to deserialize a JSON String to a Map of String -> String. I use GSON 2.2.2 and Scala 2.10. import com.google.gson.Gson import com.google.gson.reflect.TypeToken object MyTest { def main(args:…
Tim
  • 13,228
  • 36
  • 108
  • 159
3
votes
1 answer

Binary serialization and automatic properties

I have a class like this: public class Foo { public IBar {get;set;} //tons of other properties } public interface IBar { //whatever } The class is used for binary serialization (standard use of BinaryFormatter). An implementation of…
dzendras
  • 4,721
  • 1
  • 25
  • 20
3
votes
0 answers

How to Serialize and Deserialize android.graphics.Path object

I need to serialize and deserialize android.graphic.Path object. The below code (I am using) serializes and deserializes an Object public static byte[] serialize(Object obj) { ByteArrayOutputStream out = new ByteArrayOutputStream(); …
Venks88
  • 73
  • 6
3
votes
3 answers

C# XML Deserialization with indented nested tags

I know there are several questions on Stackoverflow already regarding this subject, but I still couldn't find any answer about repeating tags. If I have such a XML structure: 100
Erwin Okken
  • 233
  • 2
  • 17
3
votes
3 answers

How to convert a file of any type into byte array?

The file can be of any type ( png,bmp,jpeg,doc,docx,pdf) I have to convert the file into byte array and send to server via WebRequest where it will be converted to the corresponding file.
Ramya
  • 121
  • 2
  • 7
  • 13
3
votes
2 answers

Message serialized with XmlMessageFormater refuses to deserialize List member

I'm having a frustrating time with C# message serialization. I have a class which has a constructor which looks like this: public ProposalRequestMessage(int imaNumber, int proposalId, bool trainingFlag, string firstSiteAddress, …
RikSaunderson
  • 3,505
  • 6
  • 32
  • 50
3
votes
1 answer

Deserialize a type containing a Dictionary property using ServiceStack JsonSerializer

The code snippet below shows two ways I could achieve this. The first is using MsgPack and the second test is using ServiceStack's JSONSerializer. The second is more favourable because the ServiceStack.Text JSONSerializer is used throughout a…
leon
  • 762
  • 1
  • 10
  • 24
3
votes
1 answer

XML mapping to objects without attributes in C#

Is there a C# library that allows mapping C# objects to XML without Attributes? I have several data sources, all of them containing XML data with the same logical-structure, but different schema. For example in one XML there might be a field called…
Aleksei Poliakov
  • 1,322
  • 1
  • 14
  • 27
3
votes
1 answer

How to deserialize only part of a large xml file to c# classes?

I've already read some posts and articles on how to deserialize xml but still haven't figured out the way I should write the code to match my needs, so.. I'm apologizing for another question about deserializing xml )) I have a large (50 MB) xml…
Aleksei Chepovoi
  • 3,915
  • 8
  • 39
  • 77
3
votes
1 answer

Serialize with java 7, deserialize with java 6?

Any idea if standard (default) serialization with java 7 should be read (deserialize) with java 6?
Elad Tabak
  • 2,317
  • 4
  • 23
  • 33
3
votes
0 answers

NotSerializableException in JSF when using Spring AOP

I’m currently facing a Problem using a combination of JSF 2 and Spring 3 AOP. The Application is designed as a classic three Layer archiecture (Web, Service, Database). So the Spring managed JSF-Beans call Service Beans which represent the Business…
Compito
  • 851
  • 5
  • 6
3
votes
2 answers

ObjectInputStream custom classloader deserialization issue: resolveClass() not called

I have an ObjectInputStream and want to load classes with a custom ClassLoader. Thus is created a subclass of ObjectInputStream that overrides the resolveClass() function. Now my problem is that i want to change the ClassLoader during execution. But…
ejoerns
  • 965
  • 2
  • 11
  • 22
3
votes
1 answer

how can I loop over data serialized by jQuery and then populate a div?

I have the following serialized data string (Some of the contents are from checkboxes so that is why the 'brand' is repeated) coming from another page: brand=Ford&brand=Dodge&brand=Mazda&year=2013&type=compact and I would like to populate the div…
HPWD
  • 2,232
  • 4
  • 31
  • 61
3
votes
1 answer

ProtoBuf-Net error message " Invalid field in source data: 0"

I succeed in serializing instances of the following class but when I try to deserialize right after I get the following error message: " Invalid field in source data: 0". I have no clue what it refers to because I find below class straight forward.…
Matt
  • 7,004
  • 11
  • 71
  • 117
3
votes
2 answers

Deserialize Json to Object in a handler

I have a simple class: public class site { public string URL { get; set; } } That exists within a http handler. Currently I am posting json to this handler and trying to deserialize it to get the URL out of the string. I…
BlueBird
  • 1,406
  • 4
  • 24
  • 35