Пример #1
0
        public void Write(Double value)
        {
            V64 v = default(V64);

            v.D = value;
            Write(v.Reverse);  //Reverse后可能得到更小的值
        }
Пример #2
0
        public void Write(TimeSpan value)
        {
            V64 v = default(V64);

            v.TS = value;

            Write(v.I64);
        }
Пример #3
0
        public TimeSpan ReadTimeSpan()
        {
            V64 v = default(V64);

            v.I64 = ReadInt64();

            return(v.TS);
        }
Пример #4
0
        public double ReadDouble()
        {
            V64 v64 = default(V64);

            v64.U64 = ReadUInt64();
            v64.U64 = v64.Reverse;

            return(v64.D);
        }
Пример #5
0
        public void Write(DateTime value)
        {
            V64 v = default(V64);

            long dt = value.Ticks | (long)value.Kind << 0x3e;

            v.I64 = dt;

            Write(v.B0);
            Write(v.B1);
            Write(v.B2);
            Write(v.B3);
            Write(v.B4);
            Write(v.B5);
            Write(v.B6);
            Write(v.B7);
        }
Пример #6
0
        public DateTime ReadDateTime()
        {
            V64 v = default(V64);

            v.B0 = ReadByte();
            v.B1 = ReadByte();
            v.B2 = ReadByte();
            v.B3 = ReadByte();
            v.B4 = ReadByte();
            v.B5 = ReadByte();
            v.B6 = ReadByte();
            v.B7 = ReadByte();

            DateTime result = new DateTime(v.I64 & 0x3fffffffffffffffL, (DateTimeKind)((ulong)v.I64 >> 0x3e));

            return(result);
        }