System.Security.SecurityException.ByteArrayToObject C# (CSharp) Method

ByteArrayToObject() private static method

private static ByteArrayToObject ( byte array ) : Object
array byte
return Object
        private static Object ByteArrayToObject(byte[] array)
        {
            if(array == null || array.Length == 0)
                return null;
            MemoryStream stream = new MemoryStream(array);
            BinaryFormatter formatter = new BinaryFormatter();
            Object obj = formatter.Deserialize(stream);
            return obj;
        }

Usage Example

Example #1
0
 private MethodInfo getMethod()
 {
     return((MethodInfo)SecurityException.ByteArrayToObject(this.m_serializedMethodInfo));
 }