ByteArrayContent 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.
Initializes a new instance of the ByteArrayContent class.
Overloads
ByteArrayContent(Byte[]) |
Initializes a new instance of the ByteArrayContent class. |
ByteArrayContent(Byte[], Int32, Int32) |
Initializes a new instance of the ByteArrayContent class. |
ByteArrayContent(Byte[])
- Source:
- ByteArrayContent.cs
- Source:
- ByteArrayContent.cs
- Source:
- ByteArrayContent.cs
Initializes a new instance of the ByteArrayContent class.
public:
ByteArrayContent(cli::array <System::Byte> ^ content);
public ByteArrayContent (byte[] content);
new System.Net.Http.ByteArrayContent : byte[] -> System.Net.Http.ByteArrayContent
Public Sub New (content As Byte())
Parameters
- content
- Byte[]
The content used to initialize the ByteArrayContent.
Exceptions
The content
parameter is null
.
Remarks
The ByteArrayContent class does not internally copy the provided byte array but keeps a reference to it instead. Callers should not modify the data in the array until after the content is sent.
Applies to
ByteArrayContent(Byte[], Int32, Int32)
- Source:
- ByteArrayContent.cs
- Source:
- ByteArrayContent.cs
- Source:
- ByteArrayContent.cs
Initializes a new instance of the ByteArrayContent class.
public:
ByteArrayContent(cli::array <System::Byte> ^ content, int offset, int count);
public ByteArrayContent (byte[] content, int offset, int count);
new System.Net.Http.ByteArrayContent : byte[] * int * int -> System.Net.Http.ByteArrayContent
Public Sub New (content As Byte(), offset As Integer, count As Integer)
Parameters
- content
- Byte[]
The content used to initialize the ByteArrayContent.
- offset
- Int32
The offset, in bytes, in the content
parameter used to initialize the ByteArrayContent.
- count
- Int32
The number of bytes in the content
starting from the offset
parameter used to initialize the ByteArrayContent.
Exceptions
The content
parameter is null
.
The offset
parameter is less than zero.
-or-
The offset
parameter is greater than the length of content specified by the content
parameter.
-or-
The count
parameter is less than zero.
-or-
The count
parameter is greater than the length of content specified by the content
parameter - minus the offset
parameter.
Remarks
The ByteArrayContent class does not internally copy the provided byte array but keeps a reference to it instead. Callers should not modify the data in the array until after the content is sent.
Only the range specified by the offset
parameter and the count
parameter is used as content.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈