Microsoft.Protocols.TestSuites.MS_OXORULE.AdapterHelper.PropertyValueConvertToBinary C# (CSharp) Method

PropertyValueConvertToBinary() public static method

This method help to convert the property value, which is of variable bytes, to binary value.
public static PropertyValueConvertToBinary ( byte byteArray ) : byte[]
byteArray byte The byte array to be converted.
return byte[]
        public static byte[] PropertyValueConvertToBinary(byte[] byteArray)
        {
            // The first 2 bytes of byteArray only indicates the total length of subsequent bytes,
            // value is used to indicate the actual binary value in the Property Value returned,
            // which should not include the first 2 bytes of byteArray.
            byte[] value = new byte[byteArray.Length - 2];
            Array.Copy(byteArray, 2, value, 0, byteArray.Length - 2);

            return value;
        }