serialization

Asp.Net Deserialize Dictionary<string, object> to an object

What would be the best way to deserialize this Dictionary<string, object>{ {"fName", "John"}, {"lName", "Doe"}, {"email", "[email protected]"} } to this class Member{ string fName; string lName; string email; } ...

GWT Data Serialization

I'm looking for the algorithm that Google's Web Toolkit uses to serialize data posted to the server during an AJAX request. I'm looking to duplicate it in another language so that I can tie in another of my projects with a GWT project. Any help is much appreciated! ...

Sync only parts of a c++ vector using Boost.MPI

I have a std::vector (let's call it "data_vector") that I want to synchronize parts of across processors. I.e., I want to send the values from arbitrary indexes in that vector to other processors. I can easily do this with Boost's send() functions if I want to send the whole vector, but I really only need to send a small portion of it. ...

JSON Deserializing with Json Parsing in Android Application

Hi Team, What is "deserializing Json" means, I had seen this term on the Web. I don't know the meaning od this particular term So, it would be great if anybody can explain me about What it means actually? Thanks, david ...

Can serialize, but cannot deserialize?

I've created POCO classes with T4 Templates for EF 4.0 and generated mock for Context. Everything was great, but i don't like to initialize even small Mock-DB in C# code, so i've created some functions which generates Mock-DB from real DB and i wanted to serialize this object and use it later in some Unit Tests... XML serialization fail...

Java - ImageIcon Serialization Trouble (Last Part of Game)

I've been working on my game pretty much non stop since 11am this morning. And I'm just about done. But I get an error whenever I try to serialize and deserialize my data... There's is a "game running" class that extends JFrame. And that holds other classes that are serializable. Now, when I try to serialize those objects to a file (or...

Error: "The deserializer has no knowledge of any type that maps to this contract" ?

I have a class Foo marked [Serializable] and implementing ISerializable. I'm trying to serialize it via DataContractSerializer. In GetObjectData I do this: info.AddValue("Test", new[] { 1,2,3}); It fails with: Element ':Test' contains data of the 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:ArrayOfint' data contract....

Saving object to file using Serialization in Java

I have a large amount of data stored in a Collection. I would like to save this data to a file. Is it a good idea to use Serialization? Or should I use a custom format to save the data, or save it as XML for example? (The elements in the Collection are custom classes. Do I need to implement a method that serializes the objects?) ...

XML serialization using XStream - Problem with unmarshal

The DTO structure is like below- class VO { Map<String,DTO> values; } class DTO { Map<String,String> details; } I am using XStream to convert the above DTO to XML and back to DTO Without using any user defined converters in XStream, the converted XML looks like below- <VO> <values> <entry> <string>input 123</string> ...

Control serialization of derived type

Given a type such as: public class FooList : List<Foo> { public string SomeMessage { get; set; } } How can I get the SomeMessage property to be serialized along with the collection without overriding serialization itself? What I am getting is: <FooList> <Foo /> <Foo /> <Foo /> </FooList> and what I want is: <FooLi...

Does GWT serialize java.lang.Longs efficiently?

I'm sending object IDs back and forth from client to server through the GWT RPC mechanism. The ids are coming out of the datastore as Longs (8 bytes). I think all of my ids will only need 4 bytes, but something random could happen that gives me a 5-byte (or whatever) value. Is GWT going to be smart about packing these values in some v...

Serializing a javascript array with Jquery

I have the following code: <script type="text/javascript"> var checksSinceLastPostBack = new Array(); function clientSelectedIndexChanged(sender, eventArgs) { var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); var serializedCheckData = checksSinceLastPostBack.serializeArray(); if (ajaxManager != nu...

How can I write compressed files on the fly using Perl?

I am generating relatively large files using Perl. The files I am generating are of two kinds: Table files, i.e. textual files I print line by line (row by row), which contain mainly numbers. A typical line looks like: 126891 126991 14545 12 Serialized objects I create then store into a file using Storable::nstore. These objects usual...

Using generics in Android Java code

Hi folks, I'm a newbie in Java so I'm not sure if this is possible. Basically I need to de-serialise a file into an object of a given type. Basically the method will do this: FileInputStream fis = new FileInputStream(filename); ObjectInputStream in = new ObjectInputStream(fis); MyClass newObject = (MyClass)in.readObject(); ...

OutofMemory exception when serializing complex objects

I have a web application that serialize a very complex object that has about 500 child objects to an SQL 2008 database. The problem is when the object is very large (more than 500 child objects) it generates an outofmemory exception and we need to restart the iis. I am using the binary serializer in the .NET to serialize the object into...

CircularReferenceError when serializing an ActiveRecord instance (fetched by using ThinkingSphinx) to JSON

I try to serialize an instance of my ActiveRecord model to JSON (using "render :json => @entities" or "@entities.to_json"), but I always get an CircularReferenceError ("ActiveSupport::JSON::Encoding::CircularReferenceError (object references itself)"). This only happens when the ActiveRecord instances are queried by using ThinkingSphinx....

InvalidCastException while trying to deserialize JSON in C#

Hi everybody, I'm trying to deserialize a Json stream. I'm working under Visual Studion for Windows Phone 7. Here is the code I'm using: public Accueil() { InitializeComponent(); string baseUri = "http://path/to/my/webservice"; HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri(baseUr...

Circular Reference when using XML Serialization?

I am receiving the following exception when trying to serialize an object using XMLSerialization. A circular reference was detected while serializing an object of type MyObject} I know the circular reference is because ObjectA can have a childObject of ObjectB and ObjectB's parentObject is ObjectA, however I would like to keep that re...

Returning two things in one HttpResponse

I am trying to implement paging across ajax calls. The page should not refresh when the user wants to see the next x num of results. Here is my problem. Returning the QuerySet is super simple. I just do (sumaJson is custom) data = serializers.serialize('sumaJson', result_page.object_list, relations=('first_major', 'country_of_origin', ...

java - invoking standard deserialization inside custom deserialization

Hello, I have a simple data structure which is serialized and deserialized. Upon deserialization, I wish that the data structure itself makes a subsequent processing step. In our case, it should simply call String.intern() on all the strings it contains. Preemptive answers to unrelated questions: Why don't you simply do this after n...