System.Security.SecurityException.ByteArrayToObject C# (CSharp) 메소드

ByteArrayToObject() 개인적인 정적인 메소드

private static ByteArrayToObject ( byte array ) : Object
array byte
리턴 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

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