Пример #1
0
        // -------------------------------------------------------------------------------------------------------------
        //          Write Methods (System built-in types [Numerics])
        // -------------------------------------------------------------------------------------------------------------

        public static void Write(IntPtr Value, char *Buffer, ref int BufferLength)
        {
            if (sizeof(void *) == 8)
            {
                NumberFormatHelper.Write((ulong)Value, Buffer, ref BufferLength, 16);

                return;
            }
            NumberFormatHelper.Write((uint)Value, Buffer, ref BufferLength, 8);
        }
Пример #2
0
        // -------------------------------------------------------------------------------------------------------------
        //          Formatting Helpers
        // -------------------------------------------------------------------------------------------------------------

        public static void WriteBytes <T>(T Value, char *Buffer, ref int BufferLength) where T : unmanaged
        {
            byte *Bytes = (byte *)&Value;

            for (int SizeOf = sizeof(T) - 1; SizeOf >= 0; SizeOf--)
            {
                NumberFormatHelper.Write(Bytes[SizeOf], Buffer, ref BufferLength, 16, 2);

                if (SizeOf > 0)
                {
                    Buffer[BufferLength++] = ' ';
                }
            }
        }