ByteArrayContent 建構函式

定義

初始化 ByteArrayContent 類別的新執行個體。Initializes a new instance of the ByteArrayContent class.

多載

ByteArrayContent(Byte[])

初始化 ByteArrayContent 類別的新執行個體。Initializes a new instance of the ByteArrayContent class.

ByteArrayContent(Byte[], Int32, Int32)

初始化 ByteArrayContent 類別的新執行個體。Initializes a new instance of the ByteArrayContent class.

ByteArrayContent(Byte[])

初始化 ByteArrayContent 類別的新執行個體。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())

參數

content
Byte[]

用來初始化 ByteArrayContent 的內容。The content used to initialize the ByteArrayContent.

例外狀況

content 參數為 nullThe content parameter is null.

ByteArrayContent(Byte[], Int32, Int32)

初始化 ByteArrayContent 類別的新執行個體。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)

參數

content
Byte[]

用來初始化 ByteArrayContent 的內容。The content used to initialize the ByteArrayContent.

offset
Int32

content 參數中用來初始化 ByteArrayContent 的位移 (以位元組為單位)。The offset, in bytes, in the content parameter used to initialize the ByteArrayContent.

count
Int32

content中的位元組數目(從用來初始化ByteArrayContentoffset參數開始)。The number of bytes in the content starting from the offset parameter used to initialize the ByteArrayContent.

例外狀況

content 參數為 nullThe content parameter is null.

offset 參數小於零。The offset parameter is less than zero.

-或--or- offset 參數大於 content 參數指定的內容長度。The offset parameter is greater than the length of content specified by the content parameter.

-或--or- count 參數小於零。The count parameter is less than zero.

-或--or- count 參數大於 content 參數指定的內容長度,減去 offset 參數。The count parameter is greater than the length of content specified by the content parameter - minus the offset parameter.

備註

只有offset 參數count和參數所指定的範圍會當做內容使用。Only the range specified by the offset parameter and the count parameter is used as content. 語法Syntax

適用於