serialization

What's the best method of Encryption whilst using ProtoBuf?

I've migrated my database on my mobile device away from VistaDB because it's just too slow. I'm now using ProtoBuf instead to create a series of flat files on a Storage Card, the only issue is there's obviously no encryption. Which encryption method works best with ProtoBuf? I'm basically serializing a collection of data entities to a f...

Can strong naming cause problems with object serialization in C#?

Hi Folks, I serialize some configuration objects and store the result bytes within a database. new BinaryFormatter().Serialize(memoryStream, instance); Convert.ToBase64String(memoryStream.ToArray()); These objects will be deserialized later. new BinaryFormatter().Deserialize(memoryStream); It's possible, that the Application has ...

Why generate long serialVersionUID instead of a simple 1L?

When class implements Serializable in eclipse i have two options: add default serialVersionUID(1L) or generated serialVersionUID(3567653491060394677L). I think that first one is cooler, but many times i saw people using the second option. is there any reason to generate long serialVersionUID? ...

.NET Serialization Problem with Referencing a Static Field

I'm using SerializableAttribute to write an object jack to disk. The object has a member department which references a static field accounts of another class Department. On deserializing, I find that the member department of the deserialized object no longer points to the same object as the static field accounts but now points to another...

Should an abstract class have a serialVersionUID

In java, if a class implements Serializable but is abstract, should it have a serialVersionUID long declared, or do the subclasses only require that? In this case it is indeed the intention that all the sub classes deal with serialization as the purpose of the type is to be used in RMI calls. ...

Does using compilers from different JDK versions on the same source file break (de-)serialization?

I have a distributed application. The client and the servers share some common libraries. The client has to be compiled with a JDK 5 compiler or with target=1.5 (run anywhere also on PowerPC and CoreDuo Macs). But I would like to use SE 6 features in the server-only code. Is it ok to compile the common libraries twice - once with a JDK ...

Store and retrieve a multidimensional array using php and mysql

I have a multidimensional array in PHP like this: $array = array( "Part1" => array( "Subpart1" => array(0, 1), "Subpart2" => array(1, 0) ), "Part2" => array(0), "Part3" => array(0, 1, 0) ); Now I want to store this array in a MySQL table and retrieve it exactly like this again on another PHP page. I've...

XML Serialization is slow

I've inherited a project where the application's data model is an XML document. The developers before me had created an object model based on this xml's schema, and then coded against the object model. After several years of maintenance, this application has gradually started to show its age. The team leader has said that the key reason...

What is the best format to store contact / adress type of info without database?

Hi, My application is storing contact information. User can edit them through DataGridView and so on. I'm saving those contact info through serializable class which looks like that: [Serializable] public class Contact : INotifyPropertyChanged { private string _fName; private string _lName; private string _pNumber; ...

serializing a java object which might change later on.

I need to serialize a java object which might change later on, like some of the variables can be added or removed. What are the pit falls of such an approach and What precautions should I take, if this remains the only way out. ...

How do I binary serialize a object using Compact Framework?

I have a object struct _NETINFO { } and I want to convert it to a Byte[] using Compact Framework, I tried the following without sucess: _NETINFO info = new _NETINFO(); byte[] buffer = (byte[])info; And it doesn't work! The only other sugestion I found is to use the BinaryFormatter which isn't available in CF! Any other sugestions?...

How do I restore a transient field in Hibernate like readResolve() for hibernate serialization?

Is there a way to hook up a callback method to be called when an object is deserialized from Hibernate. Similiar to Java's readResolve() method for Java object serialization? ...

ASP.NET Custom Profile serializeAs Attribute

I am trying to implement a custom profile class in C# that inherits System.Web.Profile.ProfileBase. I have a few properties of type System.Collections.Generic.List that need to be serialized as binary instead of the default XML. However, I am unsure of how to mark that setting in Profile class. For instance, I have a property named "Sav...

How do I serialize file type input in jquery

Previously using Prototype I could serialize the input type file, it gave me the file name of the file being uploaded but when I serialized the form in jquery I just got the input type text and others not the file how do I do it? ...

Objective-C Reflection for generic NSCoding implementation

Is there any means of reflection in Objective-C that would allow you to write generic NSCoding implementations by inspecting the public properties of an object and generating generic implementations of encodeWithCoder: and initWithCoder: . I'm thinking of something like XStream for Java that allows a generic way to serialize and deseria...

c# [NonSerialized] field with inline initialization isn't initialized after deserialization

I have a [Nonserialized] field in my class that is initialized inline: [NonSerialized] private bool running = true; However, after deserializing an object I have running == false. This is not what I want. Can I force inline initializatin to work for all [NonSerialized] fields? Otherwise I will have to implement ISerializable... ...

.NET binary serialization between 32-bit and 64-bit OS

I have a program that saves data to hard drive using binary serialization. If I recompile the program on a 64-bit machine, can it deserialize the data from 32-bit machine? ...

Binary Serialization of an Array of DateTime

Hi, when i serialize an array of Int32 using the BinaryFormatter, i get about 400MB/s (100 million items in one second), but when i try to serialize an array of DateTime, i get only a throughput of about 27MB/s (100 million items in 30 seconds). One DateTime occupies eight bytes in serialized form. I guess that the BinaryFormatter uses ...

Cannot serialize Object to ViewState only Session

I have a class that is marked as serializable and have no problem storing it in the Session but when I attempt to save it in the ViewState I get: Sys.WebForms.PageRequestManagerServerErrorException: Error serializing value ...

Serialization Assembly. Is it needed or not?

I have a .net 2.0 c# ClickOnce app and it connects to its data via Web Services. I've been told that one way to potentially speed up the application is to generate a serialization assembly beforehand. I have several questions on this front. The default setting to whether to generate a serialization assembly is Auto. What criteria doe...