WuhuIslandTesting/Library/PackageCache/com.unity.scriptablebuildpipeline@1.21.5/Editor/CacheServer/IDownloadItem.cs
2025-01-07 02:06:59 +01:00

33 lines
992 B
C#

using System.IO;
namespace UnityEditor.Build.CacheServer
{
/// <summary>
/// Represents a single file download request from a Cache Server.
/// </summary>
public interface IDownloadItem
{
/// <summary>
/// the FileId (guid/hash pair) of the file to download
/// </summary>
FileId Id { get; }
/// <summary>
/// the FileType for the given FileId to download
/// </summary>
FileType Type { get; }
/// <summary>
/// Provides a writable stream for saving downloaded file bytes
/// </summary>
/// <param name="size">Size of file to download</param>
/// <returns>A writable stream</returns>
Stream GetWriteStream(long size);
/// <summary>
/// Method called when a download is finished. Used to finalize and cleanup a single file download. e.g. to move
/// a temporary file into place.
/// </summary>
void Finish();
}
}