In my current project, I use IKVM to cross-compile several Java libraries that deal with various aspects of XML. These libraries are then integrated with several .NET libraries and my main code. Everything is working fine, but I suspect there are several inefficiencies, especially in the area of ββaccess to streaming data.
Many of the Java libraries can accept SAX stream classes or other stream objects, such as OutputStream, etc. In some cases, I can wrap the corresponding Java class in a coorisponding subclass of .NET to bridge the gap and provide seamless threading between the two languages. For example, we create a class that comes from both the .NET MemoryStream and the Java OutputStream. However, in most cases, the interface is complex and I have to pass entire lines - even if I have streams available on the .NET side, and the Java side accepts (different) stream classes (and vice versa).
In general, my question is: if someone encountered similar problems, transferring data to / from IKVM compiled libraries using streams and how were they solved or mitigated? Are there any third-party solutions to help bridge this gap? For example, the code that provides Java SAX wrappers for .NET XmlReader and / or XmlWriter will be very useful.
source share