Externalizable is a java interface that allows the user to define serialization behavior.
Questions tagged [externalizable]
47 questions
294
votes
12 answers
What is the difference between Serializable and Externalizable in Java?
What is the difference between Serializable and Externalizable in Java?
Sasha
19
votes
3 answers
why we have Externalizable when we can override writeObject and readObject in java
As we can override the default serialization process by overriding writeObject() and readObject() , then What is the need of Externalizable interface?

Manjul
- 189
- 4
5
votes
2 answers
How does Externalizable differ from Serializable?
I read that
Externalizable provides us writeExternal() and readExternal() method which gives us flexibility to control java serialization mechanism instead of relying on Java's default serialization.
But If i implement Serializable and override…

Raj
- 692
- 2
- 9
- 23
4
votes
2 answers
Java Externalization vs Transient
I was thinking about the purpose of Externalisation, given that you could simply label a property as transient and prevent its serialisation. However, upon further research I found out that this approach (i.e. labelling as transient) may not be…

Grateful
- 9,685
- 10
- 45
- 77
4
votes
1 answer
Externalizable interface implmentation for a composed object in Java. (LWUIT)
I'm trying to implement the Externalizable interface to store the data using the LWUIT-IO's storage. This worked great for simple objects that are composed of Strings, booleans and ints.
However, I have an object that is composed of these types, but…

Pat
- 1,193
- 1
- 11
- 36
4
votes
3 answers
Service Loader implementations needing default public constructors
I was trying to understand how in Java Service Loader works? I came across this blog:
Could you please help me understand why the author claims:
The implementation must have a public parameterless constructor.
Okay I get the first part. Now a…

gudge
- 1,053
- 4
- 18
- 33
4
votes
1 answer
Using default Java Serialization for Externalizable classes with XStream
I am using XStream as part of my application for serializing objects. For one of the use cases, I have to serialize some of the objects implementing Externalizable interface. For my use case I would like to serialize them using native Java…

SKP
- 135
- 4
3
votes
1 answer
Why I don't have there NotSerializableException?
Why I don't have there NotSerializableException cause in class A that is serialized I have private B b that is not serialized and I know that if class implement Serializable all composite classes have to implement Serializable/Externalizable as…

Denys_newbie
- 1,140
- 5
- 15
3
votes
1 answer
Java readObject/writeObject can save/load super class, then why need read/writeExternal?
core java volumeII chapter II says, unlike readObject/writeObject, readExternal/writeExternal are able to save and restore data including the super class. I just did an experiment, and seems readObject/writeObject could do the same work:
class base…

Troskyvs
- 7,537
- 7
- 47
- 115
3
votes
3 answers
What's the rationale behind "Serializable" interface?
If we want to serialize an object, we can simply do the following implementation:
class MyClass implements Serializable
{
private static final long serialVersionUID = 12345L;
}
And no extra effort is needed to imperatively implement how the…

OneZero
- 11,556
- 15
- 55
- 92
3
votes
1 answer
Why Java complains "No Valid Constructor" even when default constructor is present?
public class ExternalizableClass implements Externalizable
{
public static ExternalizableClass CACHE = new ExternalizableClass(-1);
int id;
public ExternalizableClass()
{
id = (int)(Math.random() * 1000);
}
public…

OneZero
- 11,556
- 15
- 55
- 92
3
votes
1 answer
How to load Serialized Objects in Java by parts
I'm trying to serialize objects of big size in Java using Externalizable interface.
Code:
public class ResultsData implements Externalizable{
private static final long serialVersionUID = 1L;
private ArrayList results1;
…

JMRA
- 61
- 4
2
votes
1 answer
lwuit.io.Storage clears after closing application
I'm trying to use lwuit.io.Storage, it works fine while application is running (I can do crud) but it's data clears after closing the application.
I've considered:
registering my class with "Util.register("Car", Car.class);" in "initVars()"…

Ali Ghanavatian
- 506
- 1
- 6
- 14
2
votes
2 answers
Sending a large file over TCP channel with serialization
I'm developing a client-server system in Java. I'm sending the messaeges over a TCP channel with serialized objects.
I will also need to send files. I could just define my own custom message class:
public class SendFile implements Serializable {
…

devoured elysium
- 101,373
- 131
- 340
- 557
2
votes
0 answers
I can not override methods from Externalizable due to strange weaker access modifier error in java
In documentation says that readExternal() and writeExternal() have default access modifier and I also implement it with default access modifier, but somehow I have 2 error which says that I assign weaker access modifier? So why is that? (I know that…

Denys_newbie
- 1,140
- 5
- 15