serialization

Java swing application save custom file format

Hello, i'am writing some swing applications(not rich clients, running standalone) with a lot of domain models. Those are Java Beans, bound to the UI via presentation models. Now i need to save all the domain data in some kind of a custom project file format. The software will go through many versions, in wich the domain models always ...

How to serialize interface-typed members with protobuf .NET?

Hello, The following test fails with this error: "System.InvalidOperationException : No suitable Default IB encoding found." [ProtoContract] public class A { [ProtoMember(1)] public IB B { get; set; } } public interface IB { } [ProtoContract] public class B : IB { [ProtoMember(1)] public int SomeProperty { get;...

Why does JavaScriptSerializer ignore my converter?

I'm trying to read a JSON object which contains the date/time in a format that cannot be directly parsed by .NET's DateTime structure. In order to avoid having an 'int' field in my structure for the date/time, I wrote a custom DateTimeConverter: public class DateTimeConverter : JavaScriptConverter { public override IEnumerable<Type> S...

.Net Xml Deserialization - Support Multiple Namespaces

Hello, I need to support XML deserialization of two very similar, yet different xml files. File 1: <?xml version="1.0" encoding="UTF-8"?> <lr:LogReport xmlns:dcml="http://www.x1.org/schemas/Types/" xmlns:ds="http://www.x3.org/2000/09/xmldsig#" xmlns:lr="http://www.x.org/schemas/LogRecord/" xmlns:xs="http://www.x3.org/2001/...

Make custom class of NSObject serializable

Hi I want a custom class based on NSObject to be serializable. I have read this (http://stackoverflow.com/questions/2182115/make-a-custom-class-serializable-in-objective-c-iphone) but want to ask some additional Qs. 1) Does NSObject implement NSCoder? 2) I also want to ask if I can serialize an array of some objects of this custom cl...

Problem with Socket and Serialization C#

Guys, please help me I implemented a Client and Server model that uses Socket with thread When I want to pass only a string from Client to the Server, it works. But I want to pass an object and it throws this error: "Attempting to deserialize an empty stream" Here is the code: Client: ASCIIEncoding asen = new ASCIIEncoding(); Memo...

What are some good binary data compression Java libraries?

I'm looking into compressing binary data, more specifically serialized Java objects. I think I need an implementation of one of the algorithms that are listed on this Wikipedia page. I found a couple of tutorials and blog posts but no libraries (and most code I found seemed to be ported from other languages... and I don't trust the effic...

Stringify JS Object to JSON (Have Functions stringify into a property)

Is there a function or library that will take a JS Object that has properties and functions and stringify it to JSON but when it comes to a Function, it will change it into a property and call the function to return its value?? function object() { this.property = 12; this.function = function() { return "This"; } } So this wou...

Serialization Problems on Windows 7 64-bit with Visual Studio 2008

Has anyone experienced issues with Serialization on Windows 7 64-bit under Visual Studio 2008? I can Serialize my object before exiting with no errors, but when I open the object back up, my changed data is not there. The only difference I know of is that I am on Windows 7 64-bit (previous was Win XP 32-bit). My code below works fine,...

Persisting a heterogeneous array in C#

I have an List<Animal> but in that list I have subclasses of Animal such as Mammal. (Yes that is right; it is a school assignment, so don't be specific, just give me some pointers.) I should persist it with [Serializable] interface and that is no problem, except when I shall read it back again, I have no idea what subclass the data ca...

Transmitting commands from a client to a server in Clojure/Java

I'm working on Clojure app where a client needs to send some commands to a server. These will happen in quite large volumes, so I'd like it to be reasonably efficient, both in terms of processing and over-the-wire serialised size. What would be the best way of doing this in Clojure? Currently I'm thinking of: Creating a simple standa...

How to totally control json serialization in WCF

I need to totally control the json serialization process in my Rest WCF service. I need to substitute the serialization result, that is something similar to: { foo: 42, bar: 43 } with: myFunc( { foo: 42, bar: 43 } ); any ideas? thanks m. ...

Serializing data types for use over a network in F#

I want to send a a Uint16 over the network. I've had a look at the different .NET serializers available. According to this http://stackoverflow.com/questions/1884755/f-serialize-discriminated-union-why-so-many-bytes using a BinaryFormatter will generate overhead bytes that represent meta-data for that type. A result of this would be that...

boost::serialization deserializing xml_archive exception

Hello StackOverflow! im trying to serialize some object as xml and then read it back the code is: IncomingTradeMessage inherits BaseMessage and contains InternalRequestInfo which in turn contains InternalTradeTransInfo. this is the code: std::ostringstream oStringStream; boost::archive::xml_oarchive xmlArchive(oStringStream); xmlArch...

Can an Enum be serialized completely?

Hey everyone, I've got a .NET application running on WCF. In that application, I have a variety of "Types" defined ("CourseType", "PresentationType", "HierarchyType", etc) as enums. These are automatically synced with the database, so I can write nice code like: public enum CourseType { Online = 1, Classroom = 2 } ... if(course...

Is serialisation/deserialisation possible with Silverlight ?

Hi all, I realize easily serialisation and deserialisation of my objet with XML file. I am wondering if it is possible to do that with binary file. Thanks ! ...

Difference between serializing and deserializing and writing internals to a file and then reading them and passing them in constructor.

Lets say we have a class Class A implements serializable{ String s; int i; Date d; public A(){ } public A(String s, int i, Date d){ this.s =s; blah blah } } Now lets say one way i store all the internal values of s,i,d to a file and read them again, and pass them to the constructor and cr...

Strange problem with Streams

I am receiving an XML via an HttpPost to my service, and I want to log the received value for debugging purposes. First I deserialize it into an entity like this: XmlSerializer s = new XmlSerializer(typeof(TransactionResults)); TransactionResults t = (TransactionResults)s.Deserialize(stream); This, of course, moves the stream to the...

Rule of thumb: size of boost archive in relation to original serialized object?

For reasons that I will gloss over, I need to set aside space of a fixed size, and then use boost serialization to store an object there. The choice of archive format is arbitrary, and portability is not a concern. The class is fairly complex (members include fundamental types, arrays, pointers, and child classes) and guaranteed to gro...

How to correctly Deserialize obects while catching errors

I have a class DataFile which is the top level class that I am serializing. DataFile contains an ArrayCollection which in-turn contains objects which extend ArrayData, each which overrides readExternal in different ways. Over the course of the development the ArrayData object from version 1.0 is now different than the ArrayData object i...