All pastes #17925 Raw Edit

Miscellany

public text v1 · immutable
#17925 ·published 2005-07-17 19:08 UTC
rendered paste body
        private static string DumpByte(byte b)
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 7; i >= 0; --i) {
                int bit = 1 << i;
                if ((b & bit) != 0) {
                    sb.Append("1");
                } else {
                    sb.Append("0");
                }
            }
            return sb.ToString();
        }