Monobjc.ObjectiveCRuntime.Wrap C# (CSharp) Method

Wrap() public static method

Wraps the given exception.
public static Wrap ( Exception exception ) : byte[]
exception System.Exception The exception.
return byte[]
		public static byte[] Wrap (Exception exception)
		{
			byte[] data;

			// Serialize the exception using a binary format
			using (MemoryStream stream = new MemoryStream()) {
				BinaryFormatter formatter = new BinaryFormatter ();
				formatter.Serialize (stream, exception);
				data = stream.ToArray ();
			}

			return data;
		}
	}