Exemple #1
0
        public static void GetBytes(byte[] buffer, int offset, DateTime value, DatetimeBinaryFormat format = DatetimeBinaryFormat.WinFileTime)
        {
            switch (format)
            {
            case DatetimeBinaryFormat.WinFileTime:
                NtfsUtils.ToWinFileTime(buffer, offset, value);
                break;

            default:
                throw new ArgumentOutOfRangeException("format");
            }
        }
        public static void GetBytes(byte[] buffer, int offset, DateTime value, DatetimeBinaryFormat format = DatetimeBinaryFormat.WinFileTime)
        {
            Debug.Assert(buffer.Length - offset >= 8);      // WinFileTime requires 8 bytes
            Debug.Assert(offset >= 0);

            switch (format)
            {
            case DatetimeBinaryFormat.WinFileTime:
                NtfsUtils.ToWinFileTime(buffer, offset, value);
                break;

            default:
                throw new ArgumentOutOfRangeException("format");
            }
        }