public bool HandlePackage(NativeArray array) { using (Stream stream = array.OpenRead()) { while (stream.Position < stream.Length) { UnitType unitType = (UnitType)Int32Marshaler.Demarshal(stream); switch (unitType) { case UnitType.AppDomain: AppDomainNativeInfo[] appDomains = MarshalingManager.Demarshal <AppDomainNativeInfo[]>(stream); _appDomains.Update(appDomains); break; case UnitType.Assembly: AssemblyNativeInfo[] assemblies = MarshalingManager.Demarshal <AssemblyNativeInfo[]>(stream); _assemblies.Update(assemblies); break; case UnitType.Module: ModuleNativeInfo[] modules = MarshalingManager.Demarshal <ModuleNativeInfo[]>(stream); _modules.Update(modules); break; case UnitType.Class: ClassNativeInfo[] classes = MarshalingManager.Demarshal <ClassNativeInfo[]>(stream); _classes.Update(classes); break; case UnitType.Function: FunctionNativeInfo[] functions = MarshalingManager.Demarshal <FunctionNativeInfo[]>(stream); _functions.Update(functions); break; case UnitType.Thread: ThreadNativeInfo[] threads = MarshalingManager.Demarshal <ThreadNativeInfo[]>(stream); _threads.Update(threads); break; default: throw new TempException("Unknown UnitType"); } } } return(true); }
public bool HandlePackage(NativeArray array) { using (Stream stream = array.OpenRead()) { while (stream.Position < stream.Length) { UnitType unitType = (UnitType)Int32Marshaler.Demarshal(stream); switch (unitType) { case UnitType.ManagedException: ManagedExceptionNativeInfo[] exceptions = MarshalingManager.Demarshal <ManagedExceptionNativeInfo[]>(stream); _exceptions.Update(exceptions); break; default: throw new TempException("Unknown UnitType"); } } } return(true); }
public int ReadResultCode() { return(Int32Marshaler.Demarshal(InputStream)); }