<PackageReference Include="System.ClientModel" Version="1.17.0" />

System.ClientModel.BinaryContent

public abstract class BinaryContent : IDisposable
Represents binary content that can be sent to a cloud service as part of a PipelineRequest.
namespace System.ClientModel { public abstract class BinaryContent : IDisposable { public string MediaType { get; set; } public static BinaryContent Create(BinaryData value); public static BinaryContent Create<[Nullable(0)] T>(T model, ModelReaderWriterOptions options = null) where T : IPersistableModel<T>; public static BinaryContent Create(Stream stream); public static BinaryContent CreateJson<[Nullable(2)] T>(T jsonSerializable, JsonSerializerOptions options = null); public static BinaryContent CreateJson<[Nullable(2)] T>(T jsonSerializable, JsonTypeInfo<T> jsonTypeInfo); public static BinaryContent CreateJson(string jsonString, bool validate = false); public abstract bool TryComputeLength(out long length); public abstract Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken)); public abstract void WriteTo(Stream stream, CancellationToken cancellationToken = default(CancellationToken)); public abstract void Dispose(); protected BinaryContent(); } }