javaClassNames.add( classes[ii].getName() );
bytesOut = new ByteArrayOutputStream(); out = new ObjectOutputStream( bytesOut ); out.writeObject( obj ); return bytesOut.toByteArray();
    static void serialize( Attributes entry, Object obj ) throws NamingException    {        /* Let's add the object classes first:         * objectClass: top         * objectClass: javaObject         * objectClass: javaContainer         * objectClass: javaSerializedObject         */        Attribute objectClass = new LockableAttributeImpl( "objectClass" );        objectClass.add( TOP_ATTR );        objectClass.add( JOBJECT_ATTR );        objectClass.add( JCONTAINER_ATTR );        objectClass.add( JSERIALIZEDOBJ_ATTR );        entry.put( objectClass );        // Add the javaClassName and javaSerializedData attributes        entry.put( JCLASSNAME_ATTR, obj.getClass().getName() );        entry.put( JSERIALDATA_ATTR, serialize( obj ) );        // Add all the class names this object can be cast to:        Class[] classes = obj.getClass().getClasses();        Attribute javaClassNames = new LockableAttributeImpl( JCLASSNAMES_ATTR );        for ( int ii = 0; ii < classes.length; ii++ )        {            javaClassNames.add( classes[ii].getName() );        }        entry.put( javaClassNames );    }