No. That's like saying, "I want to display an object as text, but don't know anything about how to convert it into a string."
The entire purpose of Serializable
is to say "I know how to be serialized to a stream!" - if we didn't need it, we wouldn't have it.
Now if you have an object which implements Serializable
but contains something which itself doesn't implement Serializable
, but which you could work out some way of serializing by hand, you could always customize the serialization of the container object yourself.
Basically ObjectOutputStream
is designed for Java's serialization framework. If you don't want to use the serialization framework, don't use ObjectOutputStream
. Images in particular are likely to have their own "native format" which ImageIO
can deal with (as R. Bemrose noted).