Questions tagged [serialization]

Serialization is the process by which data-structures are converted into a format that can be easily stored or transmitted and subsequently reconstructed.

Serialization is the process of converting a or object's state into a format that can be stored (for example, in a flat file or memory ) or transmitted over a network, to be reconstructed later maintaining data integrity - typically in a different run-time environment which may or may not be on the same computer.

The process of serializing an object is sometimes referred to as - however depending on the context / language this term may take on a slightly different meaning. The process of reconstructing a data structure from its serialized form is known as .

Popular formats for serialization are and .

33160 questions
11
votes
2 answers

json.dumps(): escaping forward slashes

Since forward slashes can only occur in strings inside a JSON serialized object and are not escaped (in the default settings), using json.dump(some_dict).replace('/', r'\/') reliably works, but it looks hacky. I know that forward slashes don't…
Kijewski
  • 25,517
  • 12
  • 101
  • 143
11
votes
4 answers

FlatBuffers: Write to and read from binary file?

I have basic knowledge of file streams in C++ and Google FlatBuffers. The Schema file is quite simple, also creating a buffer and reading from a buffer pointer. The thing that I don't get is how to save multiple buffers into a binary file, and then…
Davinish
  • 195
  • 1
  • 1
  • 9
11
votes
5 answers

How to specify the order of XmlAttributes, using XmlSerializer

XmlElement has an "Order" attribute which you can use to specify the precise order of your properties (in relation to each other anyway) when serializing using XmlSerializer. public class bookingList { [XmlElement(Order = 1)] public string…
demoncodemonkey
  • 11,730
  • 10
  • 61
  • 103
11
votes
5 answers

When serializing an object, how can I prevent serialization of particular members?

I have a class that implements Serializable. When I serialize members of that class, there are certain variables/methods that I don't to want included in the serialized representation. Consider a Name class that is Serializable: class Name…
Mohit
  • 1,185
  • 2
  • 11
  • 25
11
votes
5 answers

How to deserialize null array to null in c#?

Here is my class: public class Command { [XmlArray(IsNullable = true)] public List To { get; set; } } When I serialize an object of this class: var s = new XmlSerializer(typeof(Command)); s.Serialize(Console.Out, new…
Aen Sidhe
  • 1,181
  • 12
  • 25
11
votes
3 answers

How to clone objects in NHibernate?

How to implement objects (entities) cloning in NHibernate? Each entity class has such properties: public virtual IList Clubs { get; set; } Also, the entity class inherits BaseObject. I tried to implement the solution using XML serialization,…
akrisanov
  • 3,212
  • 6
  • 33
  • 56
11
votes
1 answer

How to serialize/deserialize Chrome tab (its DOM/RenderTree))?

How to serialize a complete process? In specially if the process is a Chrome's tab (with its rendered DOM). Is it possible to completely serialize Chrome tab/(tab's DOM) and then to deserialize it again? So that the tab do not need to request HTML…
static
  • 8,126
  • 15
  • 63
  • 89
11
votes
3 answers

Even trivial serialization examples in Scala don't work. Why?

I am trying the simplest possible serialization examples of a class: @serializable class Person(age:Int) {} val fred = new Person(45) import java.io._ val out = new ObjectOutputStream(new…
MKaama
  • 1,732
  • 2
  • 19
  • 28
11
votes
4 answers

JsonProperty - Use different name for deserialization, but use original name for serialization?

I am retrieving JSON from an API. I am using newtonsoft (this is json.net right?) to deserialize this into a list of objects. It works. Unfortunately I also need to pass this along to someone else as JSON (they can't call the API directly only I…
user3520332
  • 221
  • 4
  • 10
11
votes
2 answers

Serializing data with Avro in node js

I would like to serialize data from a JSON object and send it throught the network with kafka as an end. Now I have an avro schema in a file, that determinate the fields necessary to send to kafka for the logging system: {"namespace":…
Pistolo
  • 133
  • 1
  • 2
  • 10
11
votes
1 answer

Is there a way to specify a simpler JSON (de-)serialization for std::map using Cereal / C++?

The project I'm working on is a C++ application that manages a large number of custom hardware devices. The app has a socket/port interface for the client (like a GUI). Each device type has its own well-defined JSON schema and we can serialize those…
Lee Jenkins
  • 2,299
  • 3
  • 24
  • 39
11
votes
3 answers

Is it possible to get serialVersionUID of the java class in runtime

It's well known that runtime will genereate serialVersionUID field for your class, if you failed to explicitly define it. But is it possible to get this value in runitme? Is it possible in runtime, having reference to .class, obtain it's…
ivstas
  • 1,203
  • 1
  • 16
  • 31
11
votes
4 answers

How can I keep GWT from trying to include every serializable class when I use ArrayList

I have an RPC service in GWT that needs to return a List. The List can be filled with various types of objects, all of which are serializable and all of are referenced elsewhere in my service so they should be available to GWT RPC. However, unless…
Sean
  • 892
  • 1
  • 8
  • 18
11
votes
1 answer

OData serializing

I've been trying to find a solution for custom serializing an entity returned from an OData controller for the past 2 months! Please help!!! The use case is pretty simple and I have simplified it even more to get to problematic point. I have some…
Tomer
  • 4,382
  • 5
  • 38
  • 48
11
votes
1 answer

How do you get System.Web.Script.javascriptSerializer to ignore a property?

[Serializable] public class ModelResource:ISerializable { public Int64 Ore { get; private set; } public Int64 Crystal { get; private set; } public Int64 Hydrogen { get; private set; } //needs to be ignored public Int64 Total { get {…
Maslow
  • 18,464
  • 20
  • 106
  • 193
1 2 3
99
100