vendredi 27 avril 2018

Read array of different types from ObjectInputStream

I have an Object[] array of java method's arguments which I get using my InvocationHandler. I then need to write and read the array from the object streams.

The problem is that the array can contain primitive types so

this.args = (Object[]) in.readObject();

Fails with java.lang.ClassNotFoundException int

Can anyone suggest how to properly handle this situation?





Aucun commentaire:

Enregistrer un commentaire