I need to read custom-serialized binary data, written using BinaryWriter class.
To store a date, the original designers used BinaryWriter.Write( Data.ToBinary() );
This article sort-of mentions how the ToBinary function works; but what I need, is to build code that will emulate the methods ToBinary() and FromBinary() in other programming languages.
Can anyone look at the following pseudo code and give me an idea of the real offset bit counts.
long i = DateTime.Now.ToBinary();
// will likely need to add code here to "condition" the value
int yr = (i >> 48) & 0x7fff;
int mo = (i >> 44) & 0xf;
int day = (i >> 36) & 0xff;
int hr = (i >> 28) & 0xff;
int min = (i >> 20) & 0xff;
int sec = (i >> 12) & 0xff;
int ms = i & 0xfff;
ps. will this concept even work..or is the date stored in the form of total milliseconds?