HI Artur, There are also some key features of the SceneGraph IO API which you would loose by just using Serialization.
The main feature is that the API preserves the sharing of Node Components between BranchGraphs which are sent over the IO Stream in separate operations. This is not possible with serialization..... Also using Serialization the files would be larger and would take longer to load. A key goal of the IO API was fast loading..... As for extending the IO capabilities of the API you need to implement the SceneGraphIO interface. If you want to store data using the standard java serialization here you can, just write the data to a java.io.ByteArrayOutputStream and write the byte[] in your implemenation of writeSceneGraphObject. The IO API actually uses this technique to store serializable objects that are in a nodes userData field. You can see the source in com.sun.j3d.utils.scenegraph.io.retained.Controller.java method writeSerializedData(..) Rgds Paul ---------------------------------------------------------- Paul Byrne Email : [EMAIL PROTECTED] Sun Microsystems Phone : (650) 786 9926 Visualization Software Group Fax : (650) 786 5852 ---------------------------------------------------------- >Date: Thu, 18 Apr 2002 10:12:35 -0700 >From: Doug Twilleager <[EMAIL PROTECTED]> >Subject: Re: [JAVA3D] SceneGraphIO - why not serialization ? >To: [EMAIL PROTECTED] >MIME-version: 1.0 >Content-transfer-encoding: 7BIT >Content-MD5: lUVfXHwqUBbNefV2SR3JNw== >Delivered-to: [EMAIL PROTECTED] > >It could be done that way. But, for this feature and others, we >decided to implement it as a utility first. This was to make sure >everything worked well. We could eventually fold it back into the >core as a speciallized implementation of serialization. But, the >current way of doing it gives us a bit more flexibility in defining >its behavior and characteristics. > >Doug Twilleager >Java 3D Team >Sun Microsystems > > >>Subject: [JAVA3D] SceneGraphIO - why not serialization ? >>To: [EMAIL PROTECTED] >>MIME-version: 1.0 >>Content-transfer-encoding: 7bit >>X-Accept-Language: en-us, en >>Delivered-to: [EMAIL PROTECTED] >>User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.9) >Gecko/20020311 >> >>I have just read short docs about SceneGraphIO (j3d format). I >>understand stuff with create/resolve references, but why just normal >>serialization is not used ? >> >>Wouldn't it be easier to use serialization and manually serialize tricky >>fields and add some post-serialization hooks to initialize needed native >>resources (if they are needed at all) ? >> >>Artur >> >>=========================================================================== >>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >>of the message "signoff JAVA3D-INTEREST". For general help, send email to >>[EMAIL PROTECTED] and include in the body of the message "help". > >=========================================================================== >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >of the message "signoff JAVA3D-INTEREST". For general help, send email to >[EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".