Partager via


UrlRequest.ICallback.OnReadCompleted Method

Definition

Invoked whenever part of the response body has been read.

[Android.Runtime.Register("onReadCompleted", "(Landroid/net/http/UrlRequest;Landroid/net/http/UrlResponseInfo;Ljava/nio/ByteBuffer;)V", "GetOnReadCompleted_Landroid_net_http_UrlRequest_Landroid_net_http_UrlResponseInfo_Ljava_nio_ByteBuffer_Handler:Android.Net.Http.UrlRequest/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)]
public void OnReadCompleted (Android.Net.Http.UrlRequest request, Android.Net.Http.UrlResponseInfo info, Java.Nio.ByteBuffer byteBuffer);
[<Android.Runtime.Register("onReadCompleted", "(Landroid/net/http/UrlRequest;Landroid/net/http/UrlResponseInfo;Ljava/nio/ByteBuffer;)V", "GetOnReadCompleted_Landroid_net_http_UrlRequest_Landroid_net_http_UrlResponseInfo_Ljava_nio_ByteBuffer_Handler:Android.Net.Http.UrlRequest/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)>]
abstract member OnReadCompleted : Android.Net.Http.UrlRequest * Android.Net.Http.UrlResponseInfo * Java.Nio.ByteBuffer -> unit

Parameters

request
UrlRequest

Request that received data. <strong>This is not guaranteed to be the same object as the one received by other callbacks, nor is it guaranteed to be the one returned by URLRequest.Builder#build.</strong> However, method calls on this object will have the same effects as calls on the original URLRequest.

info
UrlResponseInfo

Response information.

byteBuffer
ByteBuffer

The buffer that was passed in to UrlRequest#read UrlRequest.read(), now containing the received data. The buffer's position is updated to the end of the received data. The buffer's limit is not changed.

Attributes

Remarks

Invoked whenever part of the response body has been read. Only part of the buffer may be populated, even if the entire response body has not yet been consumed.

With the exception of Callback#onCanceled onCanceled(), no other Callback method will be invoked for the request, including Callback#onSucceeded onSucceeded() and Callback#onFailed onFailed(), until UrlRequest#read UrlRequest.read() is called to attempt to continue reading the response body.

Java documentation for android.net.http.UrlRequest.Callback.onReadCompleted(android.net.http.UrlRequest, android.net.http.UrlResponseInfo, java.nio.ByteBuffer).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to