ByteArrayContent ByteArrayContent ByteArrayContent ByteArrayContent Class

定義

提供以位元組陣列為基礎的 HTTP 內容。Provides HTTP content based on a byte array.

public ref class ByteArrayContent : System::Net::Http::HttpContent
public class ByteArrayContent : System.Net.Http.HttpContent
type ByteArrayContent = class
    inherit HttpContent
Public Class ByteArrayContent
Inherits HttpContent
繼承
ByteArrayContentByteArrayContentByteArrayContentByteArrayContent
衍生

建構函式

ByteArrayContent(Byte[]) ByteArrayContent(Byte[]) ByteArrayContent(Byte[]) ByteArrayContent(Byte[])

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

ByteArrayContent(Byte[], Int32, Int32) ByteArrayContent(Byte[], Int32, Int32) ByteArrayContent(Byte[], Int32, Int32) ByteArrayContent(Byte[], Int32, Int32)

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

方法

CopyToAsync(Stream) CopyToAsync(Stream) CopyToAsync(Stream) CopyToAsync(Stream)

將 HTTP 內容序列化成位元組資料流,然後複製到 stream 參數所提供的資料流物件。Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter.

(Inherited from HttpContent)
CopyToAsync(Stream, TransportContext) CopyToAsync(Stream, TransportContext) CopyToAsync(Stream, TransportContext) CopyToAsync(Stream, TransportContext)

將 HTTP 內容序列化成位元組資料流,然後複製到 stream 參數所提供的資料流物件。Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter.

(Inherited from HttpContent)
CreateContentReadStreamAsync() CreateContentReadStreamAsync() CreateContentReadStreamAsync() CreateContentReadStreamAsync()

以非同步作業方式建立用於讀取的 HTTP 內容資料流,而其備份存放區是 ByteArrayContent 中的記憶體。Creates an HTTP content stream as an asynchronous operation for reading whose backing store is memory from the ByteArrayContent.

Dispose() Dispose() Dispose() Dispose()

釋放 Unmanaged 資源,並處置 HttpContent 所使用的 Managed 資源。Releases the unmanaged resources and disposes of the managed resources used by the HttpContent.

(Inherited from HttpContent)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 HttpContent 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。Releases the unmanaged resources used by the HttpContent and optionally disposes of the managed resources.

(Inherited from HttpContent)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
LoadIntoBufferAsync() LoadIntoBufferAsync() LoadIntoBufferAsync() LoadIntoBufferAsync()

以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。Serialize the HTTP content to a memory buffer as an asynchronous operation.

(Inherited from HttpContent)
LoadIntoBufferAsync(Int64) LoadIntoBufferAsync(Int64) LoadIntoBufferAsync(Int64) LoadIntoBufferAsync(Int64)

以非同步作業方式將 HTTP 內容序列化至記憶體緩衝區。Serialize the HTTP content to a memory buffer as an asynchronous operation.

(Inherited from HttpContent)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ReadAsByteArrayAsync() ReadAsByteArrayAsync() ReadAsByteArrayAsync() ReadAsByteArrayAsync()

以非同步作業方式將位元組陣列的 HTTP 內容序列化。Serialize the HTTP content to a byte array as an asynchronous operation.

(Inherited from HttpContent)
ReadAsStreamAsync() ReadAsStreamAsync() ReadAsStreamAsync() ReadAsStreamAsync()

以非同步作業方式將 HTTP 內容序列化,並傳回代表內容的資料流。Serialize the HTTP content and return a stream that represents the content as an asynchronous operation.

(Inherited from HttpContent)
ReadAsStringAsync() ReadAsStringAsync() ReadAsStringAsync() ReadAsStringAsync()

以非同步作業方式將 HTTP 內容序列化為字串。Serialize the HTTP content to a string as an asynchronous operation.

(Inherited from HttpContent)
SerializeToStreamAsync(Stream, TransportContext) SerializeToStreamAsync(Stream, TransportContext) SerializeToStreamAsync(Stream, TransportContext) SerializeToStreamAsync(Stream, TransportContext)

以非同步作業方式序列化並寫入建構函式中提供的位元組陣列至 HTTP 內容資料流。Serialize and write the byte array provided in the constructor to an HTTP content stream as an asynchronous operation.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
TryComputeLength(Int64) TryComputeLength(Int64) TryComputeLength(Int64) TryComputeLength(Int64)

判斷位元組陣列是否有有效的位元組長度。Determines whether a byte array has a valid length in bytes.

屬性

Headers Headers Headers Headers

取得 HTTP 內容標頭,如 RFC 2616 中所定義。Gets the HTTP content headers as defined in RFC 2616.

(Inherited from HttpContent)

適用於