示例#1
0
        public static object parseBinaryDate(int headerPosition)
        {
            byte[] buffer = objectTable.GetRange(headerPosition + 1, 8).ToArray();
            Array.Reverse(buffer);
            double   appleTime = BitConverter.ToDouble(buffer, 0);
            DateTime result    = PlistDateConverter.ConvertFromAppleTimeStamp(appleTime);

            return(result);
        }
示例#2
0
        public static byte[] writeBinaryDate(DateTime obj)
        {
            var buffer =
                new List <byte>(RegulateNullBytes(
                                    BitConverter.GetBytes(PlistDateConverter.ConvertToAppleTimeStamp(obj)), 8));

            buffer.Reverse();
            buffer.Insert(0, 0x33);
            objectTable.InsertRange(0, buffer);
            return(buffer.ToArray());
        }