Re: [Ikvm-developers] Serialization of .Net objects
Brought to you by:
jfrijters
|
From: Todd S. <tod...@gm...> - 2006-08-31 13:31:45
|
I assume that to do what you suggest, I would need to run ikvmstub on the ikvm runtime assembly to create a jar that the java code could then use to invoke getInstanceTypeFromClass(). Is this correct? On 8/31/06, Jeroen Frijters <je...@su...> wrote: > > 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 > |