Generics Support for Serialization

Can anybody tell me why the writeObject() and readObject() methods in ObjectOutputStream and ObjectInputStream classes respectively do not have generics support in J2SE 5.0? Is it because generics support is only at compile time and not at run time? Looking forward to replies on this post.
[300 byte] By [DurgeshNayaka] at [2007-10-3 5:17:04]
# 1
I don't see what form of support they could possibly have.
ejpa at 2007-7-14 23:23:45 > top of Java-index,Core,Core APIs...
# 2
The method readObject() returns an object of type Object, which has to be subsequently cast to the correct Class type. This cast produces a warning. Can generics be used to return an object of the correct Class type?
DurgeshNayaka at 2007-7-14 23:23:45 > top of Java-index,Core,Core APIs...
# 3

There's no generics syntax that would support it, unless the method takes a parameter with a type argument of the required type, which it doesn't in this case. This sort of thing would work:

<T> T readObject(T prototype)

but readObject() doesn't take any parameters so there is nowhere for the compiler to get T from.

And in this case it makes no sense as the objects are coming from a file, not from an internal data structure which can be typechecked.

ejpa at 2007-7-14 23:23:45 > top of Java-index,Core,Core APIs...