HttpWorkerRequest.ReadEntityBody 方法

定义

已重载。Overloaded. 从客户端读取请求数据(当未预先加载时)。Reads request data from the client (when not preloaded).

重载

ReadEntityBody(Byte[], Int32)

从客户端读取请求数据(当未预先加载时)。Reads request data from the client (when not preloaded).

ReadEntityBody(Byte[], Int32, Int32)

使用要从中读取内容的指定缓冲区、字节偏移和最大字节数,从客户端读取请求数据(当未预先加载时)。Reads request data from the client (when not preloaded) by using the specified buffer to read from, byte offset, and maximum bytes.

注解

即使尚未到达流的末尾,实现也可以自由返回比请求更少的字节。An implementation is free to return fewer bytes than requested even if the end of the stream has not been reached.

此重载用于指定大于 2 GB 的消息正文的响应。Use this overload to specify the response for message bodies greater than 2 GB.

ReadEntityBody(Byte[], Int32)

从客户端读取请求数据(当未预先加载时)。Reads request data from the client (when not preloaded).

public:
 virtual int ReadEntityBody(cli::array <System::Byte> ^ buffer, int size);
public virtual int ReadEntityBody (byte[] buffer, int size);
abstract member ReadEntityBody : byte[] * int -> int
override this.ReadEntityBody : byte[] * int -> int
Public Overridable Function ReadEntityBody (buffer As Byte(), size As Integer) As Integer

参数

buffer
Byte[]

要将数据读入到的字节数组。The byte array to read data into.

size
Int32

要读取的最大字节数。The maximum number of bytes to read.

返回

已读取的字节数。The number of bytes read.

注解

即使尚未到达流的末尾,实现也可以自由返回比请求更少的字节。An implementation is free to return fewer bytes than requested even if the end of the stream has not been reached.

此重载用于指定大于 2 GB 的消息正文的响应。Use this overload to specify the response for message bodies greater than 2 GB.

ReadEntityBody(Byte[], Int32, Int32)

使用要从中读取内容的指定缓冲区、字节偏移和最大字节数,从客户端读取请求数据(当未预先加载时)。Reads request data from the client (when not preloaded) by using the specified buffer to read from, byte offset, and maximum bytes.

public:
 virtual int ReadEntityBody(cli::array <System::Byte> ^ buffer, int offset, int size);
public virtual int ReadEntityBody (byte[] buffer, int offset, int size);
abstract member ReadEntityBody : byte[] * int * int -> int
override this.ReadEntityBody : byte[] * int * int -> int
Public Overridable Function ReadEntityBody (buffer As Byte(), offset As Integer, size As Integer) As Integer

参数

buffer
Byte[]

要将数据读入到的字节数组。The byte array to read data into.

offset
Int32

开始读取的字节偏移位置。The byte offset at which to begin reading.

size
Int32

要读取的最大字节数。The maximum number of bytes to read.

返回

已读取的字节数。The number of bytes read.

注解

即使尚未到达流的末尾,实现也可以自由返回比请求更少的字节。An implementation is free to return fewer bytes than requested even if the end of the stream has not been reached.

此重载用于指定大于 2 GB 的消息正文的响应。Use this overload to specify the response for message bodies greater than 2 GB.

适用于