serialization

Public fields/properties of a class derived from BindingList<T> wont serialize

I'm trying to serialize a class that derives from BindingList(Floor), where Floor is a simple class that only contains a property Floor.Height Here's a simplified version of my class [Serializable] [XmlRoot(ElementName = "CustomBindingList")] public class CustomBindingList:BindingList<Floor> { [XmlAttribute("publicField")] publ...

JMS Performance: BytesMessage vs ObjectMessage

In terms of JMS performance, I have read that ObjectMessage should be avoided for performance reasons. How bad are ObjectMessage performance-wise? Should I serialize to a BytesMessage and manually deserialize? ...

Read UTF8(XML) Data from SQL Server 2005 the most efficient way

I want to read lots of data(single column nvarchar(max)) from SQL Server 2005 and deserialize it to an object. We are currently using the following, but this is not fast enough is there a better/efficient way to do it? using(MemoryStream stream = Encoding.UTF8.GetBytes((string)cmd.ExecuteScalar())) { XmlTextReader xmlReader; DataCon...

Serialize a structure in csharp to C++ and vice versa

Hi, Is there an easy way to serialize a csharp structure and then deserialize it from c++. I know that we can serialize csharp structure to xml data, but I would have to implement xml deserializer in c++. what kind of serializer in csharp would be the easiest one to deserialize from c++? I wanted two applications (one C++ and another csh...

Object orientation and serialization

Consider an interface like IMyInterface = interface procedure DoSomethingRelevant; procedure Load (Stream : TStream); procedure Save (Stream : TStream); end; and several classes that implement the interface: TImplementingClass1 = class (TInterfacedObject, IMyInterface) ... end; TImplementingClass2 = class (TInterfacedObject, ...

How can I deserialize xml with a default namespace?

I am trying to deserialize an Atom xml generated by one of the internal systems. However, when I try: public static MyType FromXml(string xml) { XmlSerializer serializer = new XmlSerializer(typeof(MyType )); return (MyType) serializer.Deserialize(new StringReader(xml)); } it throws an exception on the defin...

Serializing Shape objects in WPF

Hi, Does anyone know a good way to serialize a System.Windows.Shape (incl. Polygon, Circle, Triangle etc.) object so that it may be saved in a database? I have tried to serialize it using BinaryFormatter but it throws an exception saying that it is not marked as serializable. Thanks in advance for any help. Cheers, Nilu ...

Persistent field in Android service

I need to retain a complex object in my service, so I can reliably come back to it (it holds updates). Initially I coded it just as a class filed in my Service implementation but I'm observing that the updates object is periodically reset to null which tells me that server class itself is recreated. Can someone recommend lightweight reli...

How to tag an XML DateTime attribute with XmlDateTimeSerializationMode?

Is there any way I can define how a DateTime should be serialized/deserialized using something similar to the XmlAttribute tag? In the past I would make the field a string and then do something like this in the constructor: this.DateField = XmlConvert.ToString(passedObject.Date, XmlDateTimeSerializationMode.Utc); However, I'd like to...

I can't read my own .NET serialization

Hello, In our .NET application we depend on binary serialization for our application project files. The main project class file uses the following method to serialize itself (note all exceptionhandling is removed for clarity). public void ProjectSerialize(string filename) { Stream s = File.Open(filename, FileMode.Create); ...

Java Serializable

i have made a serialized class,like this ` class Example implements Serializable { transient byte i=2; transient byte j=3; Example(){System.out.println("value of i:"+i+",j:"+j);} } ` when i am serilizing n deserializing the class,i.e. class SerialClass { public static void main(String []r)//throws IOException { try{ ...

How to serialize a Property List Storing NSNull

I want to store in a NSMutableDictionary some null values using NSNull and then serialize this data using a property list. Problem is NSNull is not allowed and I get "Property list is in invalid format" error. Is there a workaround for this? Seems very surprising they didnt put NSNull on the list of valid plist objects. Thanks, D ...

Double(s) across different cpu architectures?

Is it OK to send over network double floating point values (adjusted for correct byte order of course) and using them interchangeably on different cpu architectures, specifically i386, mips (couple of different cores), powerpc (e300, e500). No extremely old hardware. Using gcc 4.2.1 as compiler with -Os for all architectures. Supposedl...

How to limit the maximum size read via ObjectInputStream from a Socket?

Is there a way to limit the maximum buffer size to be read from an ObjectInputStream in java? I want to stop the deserialization if it becomes clear that the Object in question is crafted maliciously huge. Of course, there is ObjectInputStream.read(byte[] buf, int off, int len), but I do not want to suffer the performance penalty of al...

How can BizTalk 2006 R2 consume the serialized response of a WCF service with PreserveObjectReferences = true?

We have an existing .net 3.5 WCF service with which PreserveObjectReferences is set to true on the server side. When PreserveObjectReferences is set to false BizTalk can consume the response. Is there a way to get BizTalk to consume the PreserveObjectReferences response payloads... PreserveObjectReferences manifests itself with a z:id...

Custom Serialization of base class properties

I have a class that is implementing the ISerializable interface for custom serialization. This works great for the properties in this class but the class is a derived class. The problem i'm running into is that the base class properties aren't serialized for me. The base class has the serializable attribue but doesnt implement ISerial...

Best way to serialize a Float in java to be read by C++ app?

Hi, I need to serialize a java Float to be read by an application written in C++ over Socket comms. Is there a standard for this? It would be easiest to use the method floatToIntBits in the Float Class, however I am not sure how standard that is. ...

Serialize IEnumerable<T> through the wire?

Hi, I'm using a distributed web application, with a database server housing the SQL Server 2005 database, an application server where we've installed a Microsoft Three Tier Service Application, and a web server where I using MVP with supervising controller. My service layer, on the application server, returns an IEnumerable<Country> wh...

How do I deserialize old data for a type that has changed?

I have data that has been stored using binary serialization for the following class: [Serializable] public abstract class BaseBusinessObject { private NameValueCollection _fieldErrors = new NameValueCollection(); protected virtual NameValueCollection FieldErrors { get { return _fieldErrors; } set { _fieldErrors = ...

Custom JavaScriptConverter Classes

Does anyone know of decent examples of custom JavaScriptConverter classes? The MSDN's only example is of one converting a ListItemCollection. What about custom classes? What if the custom class has a property of another custom class? Do we need two converters? Any references would be greatly appreciated. Thanks! ...