Beispiel #1
0
        public static IsoFile GetIso(string isoFile)
        {
            var isoFileStream = (Stream)File.OpenRead(isoFile);

            FormatDetector.SubType detectedFormat;

            switch (detectedFormat = new FormatDetector().DetectSubType(isoFileStream))
            {
            case FormatDetector.SubType.Cso:
                isoFileStream = new CompressedIsoProxyStream(new Cso(isoFileStream));
                break;

            case FormatDetector.SubType.Dax:
                isoFileStream = new CompressedIsoProxyStream(new Dax(isoFileStream));
                break;

            case FormatDetector.SubType.Iso:
                break;

            default:
                throw (new InvalidDataException($"Can't set an ISO for '{detectedFormat}' path '{isoFile}'"));
            }

            return(new IsoFile(isoFileStream, isoFile));
        }
Beispiel #2
0
		public static IsoFile GetIso(string IsoFile)
		{
			var IsoFileStream = (Stream)File.OpenRead(IsoFile);
			FormatDetector.SubType DetectedFormat;

			switch (DetectedFormat = new FormatDetector().DetectSubType(IsoFileStream))
			{
				case FormatDetector.SubType.Cso:
					IsoFileStream = new CompressedIsoProxyStream(new Cso(IsoFileStream));
					break;
				case FormatDetector.SubType.Dax:
					IsoFileStream = new CompressedIsoProxyStream(new Dax(IsoFileStream));
					break;
				case FormatDetector.SubType.Iso:
					break;
				default:
					throw (new InvalidDataException("Can't set an ISO for '" + DetectedFormat + "'"));
			}

			return new IsoFile(IsoFileStream, IsoFile);
		}