You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: The API is not solidified yet. I'll try to keep this guide up-to-date.
Example Code
To load a package of any supported format, use the PackageReader.ReadPackageFromFile function. It returns an AbstractPackage instance. AbstractPackage implements IDisposable so be sure to manually call Dispose() or use a using block, or else the file will be left open until your program quits.
usingGameArchives;staticclassExamples{// Example: Extracting a file called "img.png" from the root of a package:publicstaticvoidExtractFile(){using(varpkg=PackageReader.ReadPackageFromFile(@"C:\data\file.pkg")){if(pkg.RootDirectory.TryGetFile("img.png",outvarfile1)){using(varfstream=file1.GetStream())using(varostream=File.OpenWrite(@"C:\data\img.png")){fstream.CopyTo(ostream);}}}}}