docs.unity3d.com
    Show / Hide Table of Contents

    Class FileCompressor

    Since C# only has GZipStream until .NET 4.0, we are forced to implement our own packing system for artifact files. We compact all artifacts into a single GZip Stream with the header before the file name and contents. The header contains the file name length and file length (in bytes).

    Inheritance
    Object
    FileCompressor
    Namespace: UnityEditor.Build.Pipeline.Utilities
    Syntax
    public class FileCompressor

    Methods

    Compress(String, String)

    Compresses all artifacts located at a specified directory.

    Declaration
    public static bool Compress(string directoryPath, string archiveFilePath)
    Parameters
    Type Name Description
    String directoryPath

    The directory containing the artifacts.

    String archiveFilePath

    The file path at which the archive will be created.

    Returns
    Type Description
    Boolean

    Returns true if the directory was found and compressed. Returns false otherwise.

    Decompress(String, String)

    Extracts all artifacts compressed in an archive.

    Declaration
    public static bool Decompress(string archiveFilePath, string directoryPath)
    Parameters
    Type Name Description
    String archiveFilePath

    The archive to decompress.

    String directoryPath

    The path where the extracted artifacts will be stored.

    Returns
    Type Description
    Boolean

    Returns true if the archive was found and decompressed. Returns false otherwise.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023