Questions tagged [serializable]

Serialization is the process of converting a data structure or object state into a format that can be stored. The `SerializableAttribute` is a .NET Framework attribute that signifies the object is serializable. The `Serializable` Java marker interface indicates that an object can be serialized using standard JVM serialization mechanisms. Other languages and frameworks have similar abstract classes or attributes.

Serialization is the process of converting a data structure or object state into a format that can be stored.

The SerializableAttribute is a .NET Framework attribute that signifies the object is serializable. Other languages and frameworks have similar abstract classes or attributes.

The Serializable Java marker interface indicates that an object can be serialized using standard JVM serialization mechanisms.

Other uses of this tag should probably use .

891 questions
43
votes
3 answers

Portable class library: recommended replacement for [Serializable]

I am porting a .NET Framework C# class library to a Portable Class Library. One recurring problem is how to deal with classes decorated with the [Serializable] attribute, since this attribute is not part of the Portable Class Library subset.…
42
votes
5 answers

Cannot pass custom Object in an Intent: The Method Put Extra is Ambiguous for the type Intent

If I try to write Car myCarObject=getCar(); Intent details = new Intent(Start.this, DetailsCar.class); details.putExtra("Car", myCarObject); startActivity(details); Eclipse show me a compilation error "The Method Put…
AndreaF
  • 11,975
  • 27
  • 102
  • 168
41
votes
13 answers

GWT - occasional com.google.gwt.user.client.rpc.SerializationException

we are haunted by occasional occurences of exceptions such as: com.google.gwt.user.client.rpc.SerializationException: Type 'xxx' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer.For…
user1946784
  • 1,397
  • 3
  • 14
  • 20
38
votes
5 answers

Penalty to implement Serializable in Java?

Is there a penalty to add implements Serializable to a Java class? Impact on size of instantiated object or performance?
AChoice
  • 558
  • 5
  • 8
37
votes
6 answers

If my class implements Serializable, do I have to implement it in its subclasses?

If I have B extends A... and A implements Serializable, do I have to write "B implements Serializable" ? I think no, but I would like confirmation... also if I put serialization id in A... do I need to put one in B also ? should serialization id in…
ycomp
  • 8,316
  • 19
  • 57
  • 95
37
votes
4 answers

Why doesn't java.lang.Object implement the Serializable Interface?

Possible Duplicate: Why Java needs Serializable interface? According to Serializability in Java docs : Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement…
TJ-
  • 14,085
  • 12
  • 59
  • 90
35
votes
2 answers

Getting rid of the comment above Eclipse-generated serialVersionUID

This has become a pet peeve of mine. I write a class, and implement Serializible. Then eclipse warns me that I don't have a serialVersionUID, so I select "Add generated serialVersionUID" or "Add default serialVersionUID" and I end up with something…
mrip
  • 14,913
  • 4
  • 40
  • 58
34
votes
5 answers

what is difference between Parcelable and Serialization used in android

I want to know exact , whether should I used parcelable or serialization technique for sending data from one activity to other? is it compulsory to use one of them for sending data from one to other? when should I use them? and the exact…
SRam
  • 2,832
  • 4
  • 45
  • 72
33
votes
4 answers

Python serializable objects json

class gpagelet: """ Holds 1) the pagelet xpath, which is a string 2) the list of pagelet shingles, list """ def __init__(self, parent): if not isinstance( parent, gwebpage): raise Exception("Parent…
asdfgaeg
30
votes
6 answers

Use parcelable to store item as sharedpreferences?

I have a couple objects, Location, in my app stored in an ArrayList and use parcelable to move these between activities. The code for the object looks like this: public class Location implements Parcelable{ private double latitude,…
xsiand
  • 465
  • 1
  • 4
  • 10
29
votes
2 answers

Does adding [Serializable] to the class have any performance implications?

I need to add the [Serializable] attribute to a class that is extremely performance sensitive. Will this attribute have any performance implications on the operation of the class?
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
29
votes
8 answers

What is the difference between "conflict serializable" and "conflict equivalent"?

In database theory, what is the difference between "conflict serializable" and "conflict equivalent"? My textbook has a section on conflict serializable but glosses over conflict equivalence. These are probably both concepts I am familiar with, but…
taz
  • 1,506
  • 3
  • 15
  • 26
28
votes
2 answers

Can I use DataContract and Serializable together?

I am working on WCF service. My all class are already serialize using [Serializable] attribute but due to "k__BackingField" Property Naming problem I used DataContract and DataMember attribute. so Can i use both attribute together like…
Rajesh Kumar
  • 2,443
  • 3
  • 28
  • 43
24
votes
2 answers

Why does PostgreSQL serializable transaction think this as conflict?

In my understanding PostgreSQL use some kind of monitors to guess if there's a conflict in serializable isolation level. Many examples are about modifying same resource in concurrent transaction, and serializable transaction works great. But I want…
darkbaby123
  • 1,915
  • 17
  • 15
24
votes
7 answers

Use of Serializable other than Writing& Reading object to/from File

In Which Cases it is a good coding practice to use implements serializable other than Writing & Reading object to/from file.In a project i went through code. A class using implements serializable even if in that class/project no any Writing/Reading…
Anurag_BEHS
  • 1,390
  • 2
  • 22
  • 36
1
2
3
59 60