Re: [Ikvm-developers] Serialization of .Net objects
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2006-08-31 07:27:08
|
Todd Stout wrote: > I would like the users of the framework to be able to write C# classes > without introducing the ikvm-specific Serializable.__Interface. > Can this be achieved? Is there something that the java library could > look for to indicate that the C# class has the [Serializable] > attribute? If you're using 0.31 (the current development version) then you can use ikvm.runtime.Util.getInstanceTypeFromClass() to go from a java.lang.Class to a System.Type and then you can ask the System.Type if it is serializable by checking the IsSerializable (get_IsSerializable()) property. Note that you'll have to do the serialization yourself, because the standard Object[In|Out]putStream implementation doesn't support serializing .NET object. Regards, Jeroen |