serialization

Properties won't get serialized into the .designer.cs file

In VS2010, control properties won't get serialized despite the ShouldSerializeFoo method, with the DesignerSerializationVisibility.Visible/Content as well. Here's the code: class Class1 : UserControl { [Browsable(true)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public string Foo { ge...

How to add to SortedSet items from an Array?

I have a SortedSet defined this way: SortedSet<RatedMessage> messageCollection = new TreeSet<RatedMessage>(new Comp()); and I have an array of RatedMessage[] I had to use the array as the set misses the serialization feature, now I need to construct it back. Is there a quick way to add all the items from the array to the set again?...

Serialization issue with SortedSet, Arrays, an Serializable

I have this before the process: protected void onPostExecute(SortedSet<RatedMessage> result) { List<Object> list=Arrays.asList(result.toArray()); lancon.putExtra("results", list.toArray()); // as serializable } then in the other part I have Object o=this.getIntent().getSerializableExtra("results"); //at this point the o holds...

Binary file parsing: performance

Hello; I have a large binary file to parse, and i am not sure about which language to use in order to improve the performance. Initially, i was going to use C# WPF as GUI, and a c DLL to do the parsing. but my target PC is 64 bit machine. and i had trouble to set up a c DLL project in VS 2008. so i am thinking if i should move to c++ or...

Having trouble using DataContractSerializer

Hello, I'm having trouble serializing an immutable instance with the DataContractSerializer, since the properties on the class I'm serializing is missing setters. The problem is that I only want to serialize the instance (just so it can be written to a log), and I will never need to deserialize it. Is there a way to bypass this behavior...

How to customize serialization of a complex object?

I have a complex object, with fields and reference to database that I would like to pass as serialized object. I implemented the interface, but on the other hand it doesn't work out, and get unexpected errors. What I would like to do, is before serialization to tell that only the ID is serialized, and after on deserialization to get bac...

How to avoid null values serialization in HashMap?

I would like to serialize a HashMap as a string through the Jackson JSON processor. For example: String strMap = getMapper().writeValueAsString(myHashMap); result output -> {"r_id":6,"a_am":null,"smb":"Submit","a_li":null,"l_id":878,"pos":[1345,1346,1347]} I don't know how to disable null values serialization for Map. It works fine on...

How to deserialize and cast to Long all numbers?

The Jackson deserialize and cast to Integer all numbers if value in range of Integers instead it cast to Long. I would like to cast ALL values to Long. Is it exist easy solution of issue? ...

Reset IDataInput Stream

I am unsure how I would reset an IDataInput stream when deserializing data in an AIR application. What I am attempting is: public function readExternal(input:IDataInput):void { var file_version:String = null; try { file_version = input.readString(); } catch (e:Error){ //We have an older file type, attempt to parse var...

Deserialize JSON into C# dynamic object?

Is there a way to deserialize JSON content into a C# 4 dynamic type? It would be nice to skip creating a bunch of classes in order to use the DataContractJsonSerializer. ...

Serializing Java objects to XML with XStream

The problem is that every time I execute the main method, the old content of a.xml is lost and is substituted with a new one. How to append content to the a.xml file without losing the previous information? import java.io.FileNotFoundException; import java.io.PrintWriter; import com.thoughtworks.xstream.XStream; import com.thoughtworks...

Is it an efficient way to serialize JSON data in Java ?

I don't know whether this question makes sense or not. I have huge amount of JSON data with me. I am getting that data from Server to the Client side. Is it good idea to serialize the JSON object in server side ? ...

c++ boost::serialization setting a fixed class_id for a class.

Hello dear Stackoverflow! I'mm using boost to serialize and deserialize some classes Like so: boost::archive::xml_oarchive xmlArchive(oStringStream); xmlArchive.register_type(static_cast<BaseMessage *>(NULL)); xmlArchive.register_type(static_cast<IncomingTradeMessage *>(NULL)); xmlArchive.register_type(static_cast<InternalRequestInf...

Object serializable for AJAX, WCF and ViewState

Hi, consider the following class and struct public class Entity { public IdType Id {get;set;} public string Data {get;set;} } [TypeConverter(IdTypeConverter))] public struct IdType { ... any data ... } The IdTypeConverter can convert the IdType struct from and to string. Now, what I want is this class to be serializable...

Suggested DB Schema for Quotes

How would you save the quote products in a database? Serialize data? http://cl.ly/6419969e30cd26e2f32a They can create however many rows they want... It's for a quote system. Create a quote with however many products. I need to save X Product At X Qty and X Price foreach one. Serialize in the only thing I could come up with, but I hat...

Write object with transient attributes to stream (Java)

I want to write an object into a stream (or byte array) with its transient attributes to be able to reconstruct it in another VM. I don't want to modify its attributes because that object is a part of legacy application. Standard Java serialization mechanism doesn't help. What other options do I have? Update: The reason I'm asking the...

strange object serialization problem in file parsing

I have a strange problem with object serialization. in the file documentation it states as following The lead in starts with a 4-byte tag that identifies a TDMS segment ("TDSm"). The next four bytes are used as a bit mask in order to indicate what kind of data the segment contains. This bit mask is referred to as ToC (Ta...

Is PHP Serialized Object Data Clean For Mysql Injection?

Do I need to escape my object data if I'm serializing for mysql injection? ie: class Object { public $description; } $obj = new Object(); $obj->description = mysql_real_escape_string("this is my crazy string with lot's of bad // characters"); $data = serialize($obj); // <-- $data will be stored in DB or will this suffice: class...

Custom serialization with DataContractSerializer

Hi, I'm currently using wrapper classes for my DataSets ,in order to implement custom serialization. I would like to use DataContractSerializer (more like have to use it) but still support the custom serialization. The problem is that the [DataContract] and [Serializable] attributes don't seem to get along so well... how could I override...

Can objects be buffered during java serialization?

I have a very large object which I wish to serialize. During the process of serialization, it comes to occupy some 130MB of heap as an weblogic.utils.io.UnsyncByteArrayOutputStream. I am using a BufferedOutputStream to speed up writing the data to disk, which reduces the amount of time for which this object is held in memory. Is it pos...