} catch (NoSuchMethodException nsme) {
  private void callWriteMethod (Object obj, ObjectStreamClass osc) throws IOException  {    Class klass = osc.forClass();    try      {	Class classArgs[] = {ObjectOutputStream.class};	Method m = getMethod (klass, "writeObject", classArgs);	if (m == null)	  return;	Object args[] = {this};	m.invoke (obj, args);	      }    catch (InvocationTargetException x)      {        /* Rethrow if possible. */	Throwable exception = x.getTargetException();	if (exception instanceof RuntimeException)	  throw (RuntimeException) exception;	if (exception instanceof IOException)	  throw (IOException) exception;	throw new IOException ("Exception thrown from writeObject() on " +			       klass + ": " + exception.getClass().getName());      }    catch (Exception x)      {	throw new IOException ("Failure invoking writeObject() on " +			       klass + ": " + x.getClass().getName());      }  }