serialization

how to load c# object side by side

We have serialized value of some objects persisted. Now we want to make substantial changes to some objects. So what i want to do is load older version of object using old assembly then deserialize and serialize again with newer version of the object. I can have convert method which can transform old object to new one. i have been con...

Java deserialization speed

I am writing a Java application that among other things needs to read a dictionary text file (each line is one word) and store it in a HashSet. Each time I start the application this same file is being read all over again (6 Megabytes unicode file). That seemed expensive, so I decided to serialize resulting HashSet and store it to a bi...

DataContract Known Types - passing array

Im having problems when passing an generic List, trough a WCF operation. In this case, there is a List of int. The example 4 is described here in MSDN. Note that in MSDN sample, is described: // This will serialize and deserialize successfully because the generic List is equivalent to int[], which was added to known types. Above, ...

How to use CodeDomSerializer to serialize an object in .Net?

I have a class, which is defined as the following: [ToolboxItem(false)] [DesignTimeVisible(false)] [DesignerSerializer("DevExpress.XtraEditors.Design.RepositoryItemCodeDomSerializer, DevExpress.XtraEditors.v10.1.Design", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design")] [Designer("DevExpress.XtraEditors.Des...

How to serialize treeview nodes in VB6?

How can we serialize treeview nodes in VB6? I am unable to figure out how to traverse and preserve the relationships between the nodes for serialization. ...

Skipping over newly-transient fields when deserializing

I inherited the following code (and data stored using it, i.e. serialized instances of A): class A implements Serializable { private static final long serialVersionUID = 1L; int someField; B b; } class B implements Serializable { private static final long serialVersionUID = 1L; int someField; } At some point I realized that...

Implementing IEquatable in class marked with DataContract. Does it work?

What I am trying to accomplish is to be able to use List<>.Contains() using the custom data structure(s) returned by the WCF service. I implemented the IEquatable<>.Equals but it's not really working on the client side. Contains() always returns false. I am wondering if the Contains() method is actually part of the class when it's put ...

Django Deserialization

I am getting the following error: Traceback (most recent call last): File "../tests.py", line 92, in test_single_search for return_obj in serializers.deserialize("json",response, ensure_ascii=False): File "/Library/Python/2.6/site-packages/django/core/serializers/json.py", line 38, in Deserializer for obj in PythonDe...

PHP unserialize fails with non-encoded characters?

$ser = 'a:2:{i:0;s:5:"héllö";i:1;s:5:"wörld";}'; // fails $ser2 = 'a:2:{i:0;s:5:"hello";i:1;s:5:"world";}'; // works $out = unserialize($ser); $out2 = unserialize($ser2); print_r($out); print_r($out2); echo "<hr>"; But why? Should I encode before serialzing than? How? I am using Javascript to write the serialized string to a hidden fi...

boost::serialization with mutable members

Using boost::serialization, what's the "best" way to serialize an object that contains cached, derived values in mutable members, such that cached members aren't serialized, but on deserialization, they are initialized the their appropriate default. A definition of "best" follows later, but first an example: class Example { public: ...

Serialize struct with pointers to NSData

Hey guys, I need to add some kind of archiving functionality to a Objective-C Trie implementation (NDTrie on github), but I have very little experience with C and it's data structures. struct trieNode { NSUInteger key; NSUInteger count, size; id object; __strong struct trieNode ** children; __strong struct trieN...

Serialization in C#

My class structure is as follows. [Serializable] [XmlRootAttribute("person", Namespace = "", IsNullable = false)] public class Person : IDisposable { Private int _id; Private string _name; [XmlElement(“id”)] Public int Id { Get{ return _id;} Set{ _id = value;} } [XmlEle...

Having issue Deserializing array from an XML string

I'm having issues trying to deserializing my xml string that was from a dataset.. Here is the XML layout.. <DataSet> <User> <UserName>Test</UserName> <Email>[email protected]</Email> <Details> <ID>1</ID> <Name>TestDetails</Name> <Value>1</Value> </Details> <Details> <ID>2</ID> <Name>Testi...

Can anyone recommend a .Net XML Serialization library?

Can anyone recommend a .Net XML Serialization library (ideally open source). I am looking for a robust XML serialization library that I can throw any object at, which will produce a human readable XML representation of the public properties for logging purposes. I never need to be able to deserialize. XmlSerializer's requirement of...

Binary serialization and deserialization without creating files (via strings)

Hi, I'm trying to create a class that will contain functions for serializing/deserializing objects to/from string. That's what it looks like now: public class BinarySerialization { public static string SerializeObject(object o) { string result = ""; if ((o.GetType().Attributes & TypeAttribut...

GWT serialization issue

I am having a heck of a time returning an ArrayList of objects that implement IsSerializable via RPC. The IsSerializable pojo contains one variable, a String, and has a 0 parameter constructor. I have removed the .gwt.rpc file from my war and still I get: com.google.gwt.user.client.rpc.SerializationException: Type 'com.test.myApp.client...

How do I use Google's Gson API to deserialize JSON properly?

Hi, In short, this is a sketch of the JSON object I want to parse in JAVA: { object1: { item1: //[String | Array | Object] , item2: // ... //<> more items object2: { /* .. */ } //<> more objects } These are the POJO s I created for parsing (I'll leave out the import statements for brevi...

How do I get the XML data that went down the wire from a WCF Service generated from `Add Service Reference`

Assume I have code like this: var svc = new Namespace.SvcClient(); var request = new Namespace.SvcRequest(); request.SomeProperty = "Value1"; request.SomeProperty = 4.0d; var response = svc.Request(request); SetText(response.Result.ToString()); svc.Close(); What I want to have is the actual XML that got sent out as the result of svc.R...

Given the Following List (UL), how can it be serialized and sent to the Database

I have the follow structure which is created with a nested sortable: <UL id="container"> <LI id="main1"> <input type="checkbox" /> Lorem ipsum dolor sit amet, consectetur <UL> <LI id="child2"> <input type="checkbox" /> In hac habitasse platea dictumst. ...

Has inheritance become bad?

Personally, I think inheritance is a great tool, that, when applied reasonably, can greatly simplify code. However, I seems to me that many modern tools dislike inheritance. Let's take a simple example: Serialize a class to XML. As soon as inheritance is involved, this can easily turn into a mess. Especially if you're trying to serializ...