Compress integer in C# impl.