Share via


BinaryContent Class

Definition

Represents binary content that can be sent to a cloud service as part of a PipelineRequest.

public abstract class BinaryContent : IDisposable
type BinaryContent = class
    interface IDisposable
Public MustInherit Class BinaryContent
Implements IDisposable
Inheritance
BinaryContent
Implements

Constructors

BinaryContent()

Properties

MediaType

Gets the media type of the content.

Methods

Create(BinaryData)

Creates an instance of BinaryContent that contains the bytes held in the provided BinaryData instance.

Create(Stream)

Creates an instance of BinaryContent that contains the bytes held in the provided Stream instance.

Create<T>(T, ModelReaderWriterOptions)

Creates an instance of BinaryContent that contains the bytes resulting from writing the value of the provided IPersistableModel<T>.

CreateJson(String, Boolean)

Creates an instance of BinaryContent that contains the provided JSON string.

CreateJson<T>(T, JsonSerializerOptions)

Creates an instance of BinaryContent that contains the JSON representation of the provided object.

CreateJson<T>(T, JsonTypeInfo<T>)

Creates an instance of BinaryContent that contains the JSON representation of the provided object using the specified JSON type information.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

TryComputeLength(Int64)

Attempts to compute the length of the underlying body content, if available.

WriteTo(Stream, CancellationToken)

Writes contents of this BinaryContent instance to the provided Stream.

WriteToAsync(Stream, CancellationToken)

Writes contents of this BinaryContent instance to the provided Stream.

Applies to