コード例 #1
0
        public byte[] GetBinary()
        {
            var intPack = new UInt32[12];

            intPack[0] = (UInt32)((UInt32)IndicatorCorrectness * (UInt32)Math.Pow(2, 30) +
                                  VersionNumber * Math.Pow(2, 27) +
                                  Mode * Math.Pow(2, 24) +
                                  Strata * Math.Pow(2, 16) +
                                  PollingInterval * Math.Pow(2, 8) +
                                  Accuracy);
            intPack[1]  = (UInt32)Delay;
            intPack[2]  = (UInt32)Dispersion;
            intPack[3]  = (UInt32)SourseIdentifier;
            intPack[4]  = (UInt32)(UpdateTime >> 32);
            intPack[5]  = (UInt32)((UpdateTime << 32) >> 32);
            intPack[6]  = (UInt32)(StartTime >> 32);
            intPack[7]  = (UInt32)((StartTime << 32) >> 32);
            intPack[8]  = (UInt32)(TimeOfReceipt >> 32);
            intPack[9]  = (UInt32)((TimeOfReceipt << 32) >> 32);
            intPack[11] = (UInt32)(SendingTime >> 32);
            intPack[10] = (UInt32)(SendingTime << 32) >> 32;

            return(intPack.SelectMany(BitConverter.GetBytes).ToArray());
        }