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
1 answer

How does MicroStream (de)serialization work?

I was wondering how the serialization of MicroStream works in detail. Since it is described as "Super-Fast" it has to rely on code-generation, right? Or is it based on reflections? How would it perform in comparison to the Protobuf-Serialization,…
Leo Hilbert
  • 395
  • 2
  • 12
11
votes
3 answers

Serializing and De-Serializing android.graphics.Bitmap in Java

I have started work on an my first android application and have the basis of an application that handles an image with multiple layers. I am able to export a flat version of the project file as a PNG but I would like to be able to save the layered…
John Wordsworth
  • 2,591
  • 1
  • 20
  • 24
11
votes
1 answer

Saving content of a treeview to a file and load it later

In my C# WinForms program I have a treeview that only contains parent nodes (so, no childs) it is like a listbox but I needed it because of haveing differet properties of nodes like Name, Tag and Text. No I want to be able to save the content of…
Dumbo
  • 13,555
  • 54
  • 184
  • 288
11
votes
4 answers

How to sort properties alphabetically when serializing JSON using Netwonsoft library?

When serializing objects using the Netwonsoft.JSON library, it's possible to specify the output order using JsonPropertyAttribute property Order. However, I would like to also sort alphabetically the properties by default on top of that.
Michele Di Cosmo
  • 491
  • 1
  • 5
  • 18
11
votes
3 answers

Why do you extend Serializable in Scala?

I'm going through some Sapark projects in Scala, and I see that all of the objects are extending Serializable . It's like : object someName extends Serializable { //some code } I understand that serialization is often used for storing or…
div93
  • 205
  • 1
  • 3
  • 14
11
votes
6 answers

Python list serialization - fastest method

I need to load (de-serialize) a pre-computed list of integers from a file in a Python script (into a Python list). The list is large (upto millions of items), and I can choose the format I store it in, as long as loading is fastest. Which is the…
Eli Bendersky
  • 263,248
  • 89
  • 350
  • 412
11
votes
1 answer

How to add @SerialVersionUID to an anonymous class?

I want to translate the following piece of code from Java to Scala: Foo foo = new Foo() { private static final long serialVersionUID = 12345L; } Class Foo is an abstract class. How does the equivalent code look like in Scala?
soc
  • 27,983
  • 20
  • 111
  • 215
11
votes
2 answers

Kotlin Serialization: "Unresolved reference: serializer"

I'm trying out Kotlin Serialization. After setting it up following the directions, I get the Unresolved reference: serializer build error with this code: val serializer : KSerializer = User.serializer() I'm speculating that somehow the…
jingx
  • 3,698
  • 3
  • 24
  • 40
11
votes
3 answers

AttributeError : 'NoneType' object has no attribute '_meta'

The issue is I overridded the BaseUser to allow visitors to login with Email and Password instead of the Django default Username. Code works fine unless we introduce serializer. If I pass a User object to the User Serializer it gives…
11
votes
1 answer

How to use saveRDS(..., refhook = ) parameter?

I have a complicated list object, the output of a modelling function (asreml). The object contains all sorts of data types, including functions and formulas, which have environments attached. I don't want to save the environments to RDS, because…
akraf
  • 2,965
  • 20
  • 44
11
votes
3 answers

Using Json.net - partial custom serialization of a c# object

I ma using Newtonsofts' Json.Net to serialize some and array of objects to json. The objects have a common set of properties but also have Meta property which is a dictionary During serialization I want the key value pairs to be added to my json…
David
  • 8,340
  • 7
  • 49
  • 71
11
votes
1 answer

JavaScriptSerializer().Serialize : PascalCase to CamelCase

I have this javascript object var options: { windowTitle : '....', windowContentUrl : '....', windowHeight : 380, windowWidth : 480 } And I have this C# class public class…
user385411
  • 1,445
  • 1
  • 18
  • 35
11
votes
2 answers

Is there a way to tell Serde to use a struct field as a map's key?

I have a map of items that I would like to serialize to a list of structs, each having a field for the corresponding key. Imagine having a YAML file like this: name_a: some_field: 0 name_b: some_field: 0 name_c: some_field: 0 And a…
Tim Visée
  • 2,988
  • 4
  • 45
  • 55
11
votes
7 answers

What is Serializable in Java?

Possible Duplicate: What does Serializable mean? I have class Person implements Serializable { } what is the use of that and what will happen if I simply use class Person { }
John
11
votes
5 answers

Java Mysterious EOF exception with readObject

The following code produces an EOFException. Why is that? public static Info readInfoDataFromFile(Context context) { Info InfoData = null; FileInputStream fis = null; ObjectInputStream ois = null; Object object = null; if…
AZ_
  • 21,688
  • 25
  • 143
  • 191