AdvancedLauncher.Tools.Imaging.Utilities.GetIntBinaryString C# (CSharp) Метод

GetIntBinaryString() статический приватный Метод

Gets a 32 character binary string of the specified Int32 value.
This method was used during debugging and is left here just for fun.
static private GetIntBinaryString ( Int32 n ) : string
n System.Int32 The value to get a binary string for.
Результат string
        internal static string GetIntBinaryString(Int32 n)
        {
            char[] b = new char[32];
            int pos = 31;
            int i = 0;

            while (i < 32) {
                if ((n & (1 << i)) != 0) {
                    b[pos] = '1';
                } else {
                    b[pos] = '0';
                }
                pos--;
                i++;
            }
            return new string(b);
        }