I have seen the marker interfaces like serializable
in decomplier and also classes like objectInputStream
and objectOutputStream
. My query is can we create our own marker interface?
If yes then I want to do something special say I also want to serialize the object same mechanism of serialization but through my interface .
What I have cross checked is that in objectOutputStream
they are checking the instance of operator under writeobject()
else if ((paramObject instanceof Serializable)) {
writeOrdinaryObject(paramObject, localObjectStreamClass, paramBoolean);
}
Please advise me how can I make marker interface and how can I create my own class which will implement my marker interface and will do special processing of serializing ?