Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pchc.EncodeMessage.GetBytesFromUshort C# (CSharp) Method

GetBytesFromUshort() private static method

Convert the uint16 type value to byte array.
private static GetBytesFromUshort ( ushort value, bool isBigEndian ) : byte[]
value ushort An uint16 value
isBigEndian bool order of bytes. If it's big endian, set it to true, else set it to false.
return byte[]
        private static byte[] GetBytesFromUshort(ushort value, bool isBigEndian)
        {
            byte[] resultData = BitConverter.GetBytes(value);
            ReverseByFlag(resultData, isBigEndian);
            return resultData;
        }