public void writeObject ( Output output , Object object ) { if ( output == null ) throw new IllegalArgumentException ( "output cannot be null." ) ; if ( object == null ) throw new IllegalArgumentException ( "object cannot be null." ) ; beginObject ( ) ; try { if ( references && writeReferenceOrNull ( output , object , false ) ) return ; if ( TRACE || ( DEBUG && depth == 1 ) ) log ( "Write" , object , output . position ( ) ) ; getRegistration ( object . getClass ( ) ) . getSerializer ( ) . write ( this , output , object ) ; } finally { if ( -- depth == 0 && autoReset ) reset ( ) ; } }
Writes an object using the registered serializer .