Serialization of data with iostream

I'm trying to record temporal state data. This state data is sent from robot every 8ms. So I want to record complete state data into a file(state.bin). I want to serialize writing/reading state data to/from a file. And I found that everything is fine

Add XmlAttribute to class C # for serialization

I'm having a bit of a head scratching moment here, as I think I'm doing this correctly! I need to create an xml file as below, (I've left out the namespace declarations) <races> <race racename="race one"> <horse> <name>Si

How can I make sure a java object is serializable?

I'm using a 3rd party library that asks to use only serializable object with its methods. How do I ensure that a java object is serializable ? Sometimes my objects are just a list, a string or a simple POJO.If it implements Serializable.

Serializing objects with the Java Preferences API

When I first started using the Java Preferences API, the one glaring omission from the API was a putObject() method. I've always wondered why they did not include it. So, I did some googling and I found this article from IBM which shows you how to do

How to serialize / deserialize an immutable list type in C #

If I have a class defined [DataContract()] class MyObject { [DataMember()] ImmutableList<string> Strings { get; private set} } The ImmutableList<T> type comes from the immutables library https://www.nuget.org/packages/Microsoft.Bcl.Immutable.

load the xml file and read the Windows Store app

I want to load my xml file in my app and read just specific tags from my xml. Can someone help me? I have tried couple of things but all I get is the full xml text, not the specific tags. This is the code: try { StorageFolder storageFolder = Package.

PHP deserializes an object without the corresponding class

I have database rows containing serialized objects. I want to deserialize these, but the class has changed, some properties went private so the deserialization no longer works. Is there a way to force deserialization to an array or a stdClass? (or an

Serialized Objects Disappear (BinaryFormatter)

Background I have an object which I need to serialize in order to transfer to a high performance computing cluster for later use Previously, I've used the out-of-the-box binary formatter for my object which represents a statistical shape model and al

Serialize an object without object information

I am in a situation I need to serialize only the values of the members of an object to a file. for example, if the object contains 3 string members I would want the output of the serialization to be only this 3 strings without the serialization metad

Convert the JSON string to & ldquo; Object.class & rdquo;

I am currently trying to use Jackson to turn an object into a JSON string this was easily done by public byte[] toJSON(Object obj) throws IOException { ObjectMapper map = new ObjectMapper(); return map.writeValueAsString(obj).getBytes(); } Where i ru

How can I serialize an interface?

Suppose I have a Serializable class ShapeHolder that owns an object that implements a Serializable Shape interface. I want to make sure the correct concrete shape object is saved (and the correct type is later restored). How can I accomplish this? in

Serialization - Display of the object graph of a stream

I'm wondering if there's a way in which I can create a tree/view of a serialised object graph, and whether anyone has any pointers? EDIT The aim being that should we encounter a de-serialization problem for some reason, that we can actually view/prod

Serializable subclass of the non-serializable parent class

I am hitting a brickwall with serialization of a subclass of Location in android/java Location is not serializable. I have a first subclass called FALocation that does not have any instance variables. I have declared it serializable. Then I have a se

Are DataContract Attributes Required for WCF

I'm writing WCF service and his client. I want to send/receive objects of my custom classes, between service and client. I have 3 modules WCF service WCF client common class library Both WCF service and client have references to common class library.

Serialize an object to the smallest size compatible UTF8

I've got an quite simple class that contains some primitive types and some collections with mostly enums. Now I need to serialize this object to the smallest possible size that is UTF8 compatible. This is the class I need to serialize public class Co

How to save & ldquo; add another & rdquo; data in a form?

I've got a form. In this form, a user can fill out a few fields, then click "Add". The data gets turned into an HTML element, and then the form gets (partially) cleared so that he can type some more data. I'm trying to figure out how to store th

Php curl and serialize the problem

In order to pass array variables via my curl script, I am using serialize because curl POST elements must not be arrays. The string that I get after serialization is: a:10:{s:8:"question";s:18:"How are you doing?";s:11:"view_optio

Empty string serialization

I'm serializing a xml string with the following code StringReader newStringReader = new StringReader(value.Value); try { using (var reader = XmlReader.Create(newStringReader)) { newStringReader = null; writer.WriteNode(reader, false); } } finally { i

Control of serialization order in C #

I'm using an XmlSerializer to serialize an object and write it to a file. I've had quite a bit of success with the serializer doing what I want it to do in terms of nesting elements and what is serialized as elements vs attributes. Unfortunately, I'v

Should I use Json or Xml in Silverlight?

I'm communicating with several services from a SL component using both TCP sockets & HTTP web requests and we are discussing what (data) format to use - JSON or XML. I'm wondering what others have choosen and why? Cheers AWCI choose XML, purely becau

Xml deserialization fails on the 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 = "R

.Net binary serialization - How to limit the object graph?

I have an object that I'd like to serialize and distribute between processes as efficiently as possible. The object itself has a reference to another object like so: public class Foo { // Unique Identifier: public int Id; public Bar Bar; } public cla