Skip to content
Pixel edited this page Sep 13, 2023 · 1 revision

Package Class

The Package class represents a package with metadata and compressed data. It provides methods for reading and creating packages.

Fields

  • const string Version - The package version.

Properties

  • PackageMetadata Metadata - Metadata of the package.

Constructors

  • See Package.Create() and Package.Read()

Methods

  • Stream ToStream() - Creates a stream out of the compressed package, ready for writing. Returns the pkg file as a Stream.

  • byte[] ToBytes() - Creates a byte array out of the compressed package, ready for writing.

  • Package Read(Stream stream) - Reads a pkg file represented as a Stream and returns a Package instance.

  • Package Read(byte[] bytes) - Reads a pkg file represented as a byte array and returns a Package instance.

  • Package Read(string path) - Reads a pkg file from a path and returns a Package instance.

  • Package Create(byte[] data) - Creates a new Package with data from an uncompressed byte array.

  • Package Create(Stream data) - Creates a new Package with data from an uncompressed stream.

  • MemoryStream GetCompressedData() - Gets the compressed data of the Package as a MemoryStream.

  • MemoryStream GetUncompressedData() - Uncompresses the Package's data and returns it as a MemoryStream.