public bool CheckIsValidStream(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            var unManagedStreamAdapter = new UnmanagedStreamAdapter(stream);

            try {
                var stPartition = ExtX_Init(unManagedStreamAdapter.StreamPtr);
                if (stPartition == IntPtr.Zero)
                {
                    return(false);
                }
                else
                {
                    ExtX_Exit(stPartition);
                    return(true);
                }
            }
            catch (Exception ex) {
                LoggerService.WriteCallerLine(ex.Message);
                return(false);
            }
            finally {
                unManagedStreamAdapter.Dispose();
            }
        }
 public void Clean()
 {
     _fs.Close();
     _adapter.Dispose();
 }
Beispiel #3
0
 public void Clean()
 {
     _unManagedStreamAdapter.Dispose();
     Partition_Exit(_partPtr);
 }