<p>Does anyone have a good solution for integrating some C# code into a java application? </p>

<p>The code is small, so I could re-write in java, but I would rather reuse the code if possible. Don't repeat yourself, etc. </p>

<p>Also, I know I can expose the C# as a web service or whatever, but it has some security/encryption stuff in there, so I would rather keep it tightly integrated if possible.</p>

<hr>

<p>Edit: It's going to be on a server-based app, so "downloading" another runtime is irrelevant.</p>

If it's short, I think you're better off re-writing the code in java.  Downloading one 50Mb runtime is bad enough.