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); }
public static byte[] WriteBinaryDate(DateTime obj) { List <byte> buffer = new List <byte>(RegulateNullBytes(BitConverter.GetBytes(PlistDateConverter.ConvertToAppleTimeStamp(obj)), 8)); buffer.Reverse(); buffer.Insert(0, 0x33); objectTable.InsertRange(0, buffer); return(buffer.ToArray()); }