Skip to content

Getting Started

Andrew Kolman edited this page Dec 19, 2023 · 4 revisions

The EggFile and EggArchive classes are similar in design to the ZipFile and ZipArchive classes in .NET. EggFile is a static class that provides utility functions for extracting EGG files. EggArchive is an object class that provides access to the EGG file and its entities (a List of EggArchiveEntry items).

Extract from file on disk to directory

EggFile.ExtractToDirectory(@"someEggFile.egg", @"C:\outputDirectory");

Open an an EGG archive and use a StreamReader to extract all text from "myFile.txt"

using var archive = new EggArchive(@"someEggFile.egg");
using var myFileStream = archive.Entries.Single(e => e.Name == "myFile.txt").Open();
using var sr = new StreamReader(myFileStream);
var text = sr.ReadToEnd();

Note

netstandard2.1 package applies nullable where applicable. Since nullable wasn't added until C# 8.0, and netstandard2.0 is only compatible with C#7.3, nullable params do not exist in netstandard2.0 release.