LIBOMV-460 LIBOMV-423 BinaryLLSD Unit Tests Failing, this appears to be caused by an Endian issue
git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2506 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -627,7 +627,13 @@ namespace OpenMetaverse.StructuredData
|
||||
public override byte[] AsBinary()
|
||||
{
|
||||
TimeSpan ts = value.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
return Utils.DoubleToBytes(ts.TotalSeconds);
|
||||
|
||||
byte[] bytes = Utils.DoubleToBytes(ts.TotalSeconds);
|
||||
|
||||
if (BitConverter.IsLittleEndian)
|
||||
Array.Reverse(bytes);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public override DateTime AsDate() { return value; }
|
||||
|
||||
Reference in New Issue
Block a user