OpenHome.Net.ControlPoint.Invocation.OutputBinary C# (CSharp) Method

OutputBinary() public static method

Utility to retrieve the value of a binary type output argument
Must only be called once per output argument. (The first call extracts the binary data from the underlying native object so later calls would return an empty string.)
public static OutputBinary ( IntPtr aHandle, uint aIndex ) : byte[]
aHandle System.IntPtr Invocation handle
aIndex uint Zero-based index into array of output arguments. /// Must refer to an ArgumentString.
return byte[]
        public static byte[] OutputBinary(IntPtr aHandle, uint aIndex)
        {
            IntPtr data;
            uint len;
            CpInvocationGetOutputBinary(aHandle, aIndex, out data, out len);
            if (data == IntPtr.Zero)
            {
                return null;
            }
            byte[] bin = new byte[len];
            Marshal.Copy(data, bin, 0, (int)len);
            OhNetFree(data);
            return bin;
        }