Java to C# conversion.