コード例 #1
0
 public CPIOFileStream(string fileName)
     : base(fileName, FileMode.Open)
 {
     _cpioFileStream = new ICPIOFormat[]
     {
          new CRCFormat(this)
         ,new NewASCIIFormat(this)
         ,new ODCFormat(this)
         ,new BinaryFormat(this)
     };
     _currentCpioFileStream = _cpioFileStream.FirstOrDefault(g => g.DetectFormat());
     if (_currentCpioFileStream == null)
     {
         throw new InvalidDataException(string.Format("File {0} has invalid format", fileName));
     }
 }
コード例 #2
0
        public CPIOFileStream(string fileName)
            : base(fileName, FileMode.Open)
        {
            var cpioFileStream = new ICPIOFormat[]
            {
                new CRCFormat(this)
                , new NewASCIIFormat(this)
                , new ODCFormat(this)
                , new BinaryFormat(this)
            };

            _currentCpioFileStream = cpioFileStream.FirstOrDefault(g => g.DetectFormat());
            if (_currentCpioFileStream == null)
            {
                throw new InvalidDataException(string.Format("File {0} has invalid format", fileName));
            }
        }