Imagine I have a class Foo
which has had the serialVersionUID
s 1, 3 and 17 in the past and I need to be able to read all three versions into Foo
instances. How do I do that?
I specifically need to know which version was saved in the byte stream, so I can do some data migration. How do I get access to the serialVersionUID
in readObject()
? Or is that already too late?