* Added Utils.UInt64ToBytesBig()
git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3422 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -509,12 +509,27 @@ namespace OpenMetaverse
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static byte[] UInt64ToBytesBig(ulong value)
|
||||
{
|
||||
byte[] bytes = BitConverter.GetBytes(value);
|
||||
if (BitConverter.IsLittleEndian)
|
||||
Array.Reverse(bytes);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static void UInt64ToBytes(ulong value, byte[] dest, int pos)
|
||||
{
|
||||
byte[] bytes = UInt64ToBytes(value);
|
||||
Buffer.BlockCopy(bytes, 0, dest, pos, 8);
|
||||
}
|
||||
|
||||
public static void UInt64ToBytesBig(ulong value, byte[] dest, int pos)
|
||||
{
|
||||
byte[] bytes = UInt64ToBytesBig(value);
|
||||
Buffer.BlockCopy(bytes, 0, dest, pos, 8);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert a floating point value to four bytes in little endian
|
||||
/// ordering
|
||||
|
||||
Reference in New Issue
Block a user