writeUTF() with null arg in Externalizable's writeExternal()
In the writeExternal() method of a class implementing java.io.Externalizable, I call writeObject(String) instead of writeUTF(String) because the String arg may be null and writeUTF() throws a NullPointerException if the arg passed is null. My assumption is that writeObject() will take care of writing null if the arg is null or call writeUTF(String) otherwise. In my corresponding readExternal() I can just do (String)in.readObject().
Do you see any flaw in this? Any overhead issue with this that may be of significance? Any better pattern to use?
Thanks
Vijay

