serialization

What is a "serialized" object in programming?

I've seen the term "serialized" all over, but never explained. Please explain what that means. ...

Java invalid stream header: 7371007E

Hi all, I am building a client-server application. Now I want to forward the message from a client to all other client with this code: ArrayList<User> usrs = _usrHandler.getUsers(); for(User usr : usrs) { if(!usr.getSocket().equals(_connection)) { usr._oOut.writeObject(new CommunicationMessage(this._comMsg.getMessage(), Com...

.NET, C#: How to add a custom serialization attribute that acts as ISerializable interface

I am doing some serialization of db linq objects, which contain EntitySet and EntityRef classes. I found a pretty easy way to deal with serialization of these classes, by simply using ISerializable to properly handle members of this type (converting them to lists for serialization, and undoing it on deserialization). However, it would ...

Writing AxShockwaveFlash Flash Object to File C#

hi guys, i was wonder if there is any way one can read-write (or save/load) AxShockwaveFlash Flash Object to a (binary/text)file? I have a Winform with AxShockwaveFlash Flash Object on it and want it to be save to a file ,but serialization doesnt not work as type AxShockwaveFlash is not marked for Serialization? (Basically trying...

Rails save object to cookie

How can I serialize an array or an object and then save it into a cookie? cookies[:mydata] = serialize({ :key1 => 'tralala', :key2 => 'hahaha' }) Thx! ...

.Net Represent xml in class without xsd

How would I represent something like this <product> <sku>12452</sku> <attribute name="details">good stuff</attribute> <attribute name="qty">5</attribute> </product> for use in my WCF service? Not sure how to define the multiple attributes whose only difference is the "name". I need this properly setup as a DataMember so xml ...

Record size of objects as they're being serialized?

What's the best way to record the size of certain objects as they are being serialized? For example, once objects of type A, B, C are serialized, record the size of their serialized bytes. We can get the size of the entire object graph via getBytes, but we'd like to break it down as to what are the largest contributors to the overall s...

String formatting c# decode?

Hi , I have a string which looks like this '%7B%22id%22%3A1%2C%22name%22%3A%22jim%22%7D' When read from a cookie it is in fact a JSON object and should look like {"id":1,"name":"jim"} Do I need to HTML decode the string to make it appear in the correct JSON notation? Thanks, ...

How to make sgen.exe keep the version of the assembly?

I want to create a serialization assembly for my assembly. sgen does it fine, but I can't figure out how to get it to assign the serialization assembly the same version as the source assembly. Any ideas? ...

Make a Custom Class Serializable in Objective-c/iPhone?

How can I make my own custom class serializable? I specifically want to write it to a file on iPhone, just plist and thee class is just a simple instance class, just NSStrings and maybe a NSUrl. ...

Represent XML without xsd

Note: I cannot use XSD... not going to go into why. I'm having a problem properly representing the following xml in a class that it should get deserialized into: XML: <product> <sku>oursku</sku> <attribute name="attrib1">value1</attribute> <attribute name="attrib2">value2</attribute> <attribute name="attribx">valuex</attri...

C# - Deserialize a class with an internal constructor

I am working on a drag and drop system for my WPF App. The way it works is: I take the dragged Item Serialize it to xml When it gets dropped I deserialize it again. This worked fine in my test app. However, now that I am trying to do it in my real app, I have hit a snag. The class I am trying to deserialize (Microsoft.TeamFou...

Deserialize complex JSON object using ASP.NET?

Hi! I've successfully created code that serializes a complex javascript object and posts it to an ASP.NET page. I can get the JSON string using Request.Form and the result looks like this (I've added indentation for readability): { "gasterPerStolPerVecka": { "name": "gasterPerStolPerVecka", "keyValue_id": "2", ...

using boost::iostreams to read specifically crafted data, then based on that create object and append it to list

I have an interesting problem. Let's say that i have file with lines filled like this: name1[xp,y,z321](a,b,c){text};//comment #comment name2(aaaa); also I have (simplified) class: class something { public: something(const std::string& name); addOptionalParam(const std::string& value); addMandatoryParam(const std::string& value); ...

XML Serialization - Is it possible to serialize a model in this way?

I have the following model: public class ABaseObject { private Guid id = Guid.NewGuid(); public ABaseObject() { } public Guid ID { get { return id; } } } public class ADerivedObject : ABaseObject { public ADerivedObject() { } public string Name { get; set; } } public class AObjectCollection<T> { ...

Better to serialize NHibernate DetachedCriteria or LINQ-to-NHibernate expressions over WCF?

What I'd like to do: 1. Create an arbitrary LINQ query based on user-selected criteria that will 2. Query against a proxy collection (facade) that 3. Converts the query to NHibernate DetachedCriteria and serializes OR just serializes the LINQ expression and then 4. Sends the serialized query to the server via WCF, where 5. The service im...

Should I map a DTO to/from a domain entity on both client and server sides?

I've got a rich domain model, where most classes have some behaviour and some properties that are either calculated or expose the properties of member objects (which is to say that the values of these properties are never persisted). My client speaks to the server only via WCF. As such, for each domain entity, I have a corresponding DT...

Xml Deserialization Fails on Empty Element

I have an Xml document that looks similar too <Reports xmlns=""> <Report> <ReportID>1</ReportID> <ParameterTemplate /> </Report> </Reports> It fails serializing to this object [XmlType(TypeName = "Report")] public class Report { [XmlElement("ReportID")] public int ID { get; set; } [XmlElement("ParameterTempla...

How to make DataContractSerializer safer?

I'm ran into a scenario recently where one of our devs added an object to our data contract that was not marked as a data member. We are using using the DataContractSerializer to store a configuration file for a piece of hardware we are controlling. The serialize operation did not succeed, obviously. The major problem this uncovered w...

C# - Deserialize a List<String>

I can serialize a list really easy: List<String> fieldsToNotCopy =new List<String> {"Iteration Path","Iteration ID"}; fieldsToNotCopy.SerializeObject("FieldsToNotMove.xml"); Now I need a method like this: List<String> loadedList = new List<String(); loadedList.DeserializeObject("FieldsToNotMove.xml"); Is there such a method? Or am...