Пример #1
0
        public byte[] ReadFileBytes(string path)
        {
            string fullPath = System.IO.Path.GetFullPath(path);

            if (File.Exists(fullPath))
            {
                return(File.ReadBytes(fullPath));
            }

            CryPkgPath pkgPath = GetPackagedPath(fullPath, false);

            if (pkgPath == null)
            {
                throw new System.IO.FileNotFoundException(path);
            }
            return(pkgPath.Package.ReadFileBytes(pkgPath.Path));
        }
Пример #2
0
 private void EnsureCachePopulated(string path, bool isDir)
 {
     foreach (string pkgPath in GetAllPossiblePkgPaths(path, isDir))
     {
         if (!packageStatuses.ContainsKey(pkgPath))
         {
             string pkgRealPath = pkgPath.Replace("/", Path.Separator);
             if (File.Exists(pkgRealPath))
             {
                 CryPkgDecoder pkg = new CryPkgDecoder(File.ReadBytes(pkgRealPath));
                 packageStatuses[pkgPath] = pkg;
             }
             else
             {
                 packageStatuses[pkgPath] = null;
             }
         }
     }
 }