BinaryContent.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
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>. |
Create(BinaryData)
- Source:
- BinaryContent.cs
- Source:
- BinaryContent.cs
Creates an instance of BinaryContent that contains the bytes held in the provided BinaryData instance.
public static System.ClientModel.BinaryContent Create (BinaryData value);
static member Create : BinaryData -> System.ClientModel.BinaryContent
Public Shared Function Create (value As BinaryData) As BinaryContent
Parameters
- value
- BinaryData
The BinaryData containing the bytes this BinaryContent will hold.
Returns
An an instance of BinaryContent that contains the bytes held in the provided BinaryData instance.
Applies to
Create(Stream)
- Source:
- BinaryContent.cs
- Source:
- BinaryContent.cs
Creates an instance of BinaryContent that contains the bytes held in the provided Stream instance.
public static System.ClientModel.BinaryContent Create (System.IO.Stream stream);
static member Create : System.IO.Stream -> System.ClientModel.BinaryContent
Public Shared Function Create (stream As Stream) As BinaryContent
Parameters
- stream
- Stream
The Stream containing the bytes this BinaryContent will hold.
Returns
An an instance of BinaryContent that contains the bytes held in the provided Stream instance.
Applies to
Create<T>(T, ModelReaderWriterOptions)
- Source:
- BinaryContent.cs
- Source:
- BinaryContent.cs
Creates an instance of BinaryContent that contains the bytes resulting from writing the value of the provided IPersistableModel<T>.
public static System.ClientModel.BinaryContent Create<T> (T model, System.ClientModel.Primitives.ModelReaderWriterOptions? options = default) where T : System.ClientModel.Primitives.IPersistableModel<T>;
static member Create : 'T * System.ClientModel.Primitives.ModelReaderWriterOptions -> System.ClientModel.BinaryContent (requires 'T :> System.ClientModel.Primitives.IPersistableModel<'T>)
Public Shared Function Create(Of T As IPersistableModel(Of T)) (model As T, Optional options As ModelReaderWriterOptions = Nothing) As BinaryContent
Type Parameters
- T
Parameters
- model
- T
The IPersistableModel<T> to write.
- options
- ModelReaderWriterOptions
The ModelReaderWriterOptions, if any,
that indicates what format the model
will be written in.
Returns
An instance of BinaryContent that wraps a IPersistableModel<T>.
Applies to
Azure SDK for .NET