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.

返回

Int32

读取的字节数。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.

适用于

产品 Introduced

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.

返回

Int32

读取的字节数。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.

适用于

产品 Introduced