FileBinaryContent Constructors
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
| Name | Description |
|---|---|
| FileBinaryContent(BinaryData, String) |
Initializes a new instance of FileBinaryContent that contains the bytes held in the provided BinaryData instance. |
| FileBinaryContent(Stream, String) |
Initializes a new instance of FileBinaryContent that contains the bytes held in the provided Stream instance. |
| FileBinaryContent(String, String) |
Initializes a new instance of FileBinaryContent that contains the bytes held in the file at the provided path. |
FileBinaryContent(BinaryData, String)
- Source:
- FileBinaryContent.cs
Initializes a new instance of FileBinaryContent that contains the bytes held in the provided BinaryData instance.
public FileBinaryContent(BinaryData data, string? mediaType = "application/octet-stream");
new System.ClientModel.FileBinaryContent : BinaryData * string -> System.ClientModel.FileBinaryContent
Public Sub New (data As BinaryData, Optional mediaType As String = "application/octet-stream")
Parameters
- data
- BinaryData
The BinaryData containing the bytes this FileBinaryContent will hold.
- mediaType
- String
The media type of the content. Ignored if
data already specifies a media type via
MediaType.
Applies to
FileBinaryContent(Stream, String)
- Source:
- FileBinaryContent.cs
Initializes a new instance of FileBinaryContent that contains the bytes held in the provided Stream instance.
public FileBinaryContent(System.IO.Stream stream, string? mediaType = "application/octet-stream");
new System.ClientModel.FileBinaryContent : System.IO.Stream * string -> System.ClientModel.FileBinaryContent
Public Sub New (stream As Stream, Optional mediaType As String = "application/octet-stream")
Parameters
- stream
- Stream
The Stream containing the bytes this FileBinaryContent will hold.
- mediaType
- String
The media type of the content.
Applies to
FileBinaryContent(String, String)
- Source:
- FileBinaryContent.cs
Initializes a new instance of FileBinaryContent that contains the bytes held in the file at the provided path.
public FileBinaryContent(string path, string? mediaType = "application/octet-stream");
new System.ClientModel.FileBinaryContent : string * string -> System.ClientModel.FileBinaryContent
Public Sub New (path As String, Optional mediaType As String = "application/octet-stream")
Parameters
- path
- String
The path to the file containing the bytes this FileBinaryContent will hold.
- mediaType
- String
The media type of the content.
Exceptions
No file exists at path.
Remarks
The file's existence is verified eagerly so that an invalid path fails fast at construction time.