Questions tagged [externalizable]

Externalizable is a java interface that allows the user to define serialization behavior.

47 questions
0
votes
2 answers

How do you Externalize a List in Java

I have a class which implements Externalizable which contains three objects and a List of one of those three object types. I have assumed you would simply implement externalizable in the sub classes and then define read and write external for the…
nrmad
  • 422
  • 9
  • 19
0
votes
1 answer

how to scan a springboot application to list hard coded values?

We are looking at externalizing the configuration of an springboot app. Is there a way to scan the code and list all the hard coded values?
0
votes
2 answers

What is best way to externalize error messages(resource bundles) out of src code in spring and springboot?

I am looking for best way to externalize my validation error messages out of my src code in spring and spring boot application, in order to avoid build/deployment on each time the error messages changes. Is there possibly any such ways to achieve…
0
votes
1 answer

Externalizable array in Java

I need to send over the network an array of Externalizable objects for maintainability and performance reasons (Serializable is not enough). The documentation says that all arrays in Java are Serializable. Is it possible to have an array that is…
Michal Kordas
  • 10,475
  • 7
  • 58
  • 103
0
votes
1 answer

How to externalise configuration variable for non Spring application in java

I am using jdk 8 and am trying to externalise database connection variables in my java application. There is one way to do this like System.getEnv("key") but I dont need to use this. Can anyone help to achieve this without Spring. my…
SST
  • 2,054
  • 5
  • 35
  • 65
0
votes
1 answer

Behaviour of externalizable interface when write external has more properties than read external

I am exploring on externalizable interface. I found a strange behaviour when I wrote more property in serialized file than what I read. Below is my employee class. public class Employee implements Externalizable { private int id; private…
shiva kumar
  • 21
  • 1
  • 10
0
votes
1 answer

Serializable or Exernalizable with huge datasets, which one is faster and more practicable?

Alright, before i come to my question i want to point out first that i know the difference between Serializable and Exernalizable so you do not need to give an explanation! What i am basically trying to do is saving a class with all its data in a…
Fabian Schmidt
  • 334
  • 1
  • 13
0
votes
1 answer

Difference between custom serialisation and Externalisation?

Recently from any source, I came to know that custom serialisation is a process where we can define writeObject(ObjectOutputStream os) and readObject(ObjectInputStream is) in our Serializable class, and these methods will be executed at the time of…
0
votes
1 answer

Serialization: Can't find non-serializable component of desired serialized object

I got an object which should be serialized. Atm I let it implement Serializable but in runtime I get an Failed to marshal object with optimized marhshaller:{ $heresAhugeString$ } Failed to serialize object: { $alsoHugeString$ }…
0
votes
0 answers

Why can't a class implementing **Externalizable** use the auto generated no-arg construtor provided by the JVM?

Why can't a class implementing Externalizable use the auto generated no-arg construtor provided by the JVM? Why does it need a no-arg constructor?
aastha
  • 1
  • 1
0
votes
0 answers

Implementing serializable and externalizable in the same class?

I was reading through Serialization and Externalization in Java. Individually I was able to use both the interfaces and was able to serialize and deserialize an object. But as in Java, a class can implement multiple interface. I implemented both…
Nicky
  • 1,025
  • 3
  • 15
  • 29
0
votes
1 answer

readExternal() not working as expected?

I am using Externalization in this example. First I serialized the object into the file named "tmp" using writeExternal() method .But when I am deserializing it using readExternal() i am getting the output as follows... default The original car is…
Abhishek Jain
  • 35
  • 1
  • 4
0
votes
3 answers

Conversion form int to long

I have created a class called Employee and I have an ArrayList for storing all the contact numbers of the employee. I have defined a method called addcontact() to add numbers to the list. If I use an int then it says that the number is out of range,…
0
votes
1 answer

Questions regarding Externalizable and Serializable

We can take use of readResolve and writeReplace methods to designate replacement objects for both Externalizable and Serializable instances... Just wanted to know couple of things: 1)Can readObject(ObjectInputStream is ) and…
Kumar Abhinav
  • 6,565
  • 2
  • 24
  • 35
0
votes
2 answers

Get all serialized fields in Externalizable class

I have several Externalizable classes. How can I write a method that returns all fields that are serialized? Alternatively, how can I determine which fields have been serialized?