public abstract class

ByteArrayCronetCallback

extends InMemoryTransformCronetCallback<byte[]>
java.lang.Object
   ↳ org.chromium.net.UrlRequest.Callback
     ↳ org.chromium.net.apihelpers.ImplicitFlowControlCallback
       ↳ org.chromium.net.apihelpers.InMemoryTransformCronetCallback<byte[]>
         ↳ org.chromium.net.apihelpers.ByteArrayCronetCallback

Class Overview

A specialization of InMemoryTransformCronetCallback which returns the body bytes verbatim without any interpretation.

Summary

Public Constructors
ByteArrayCronetCallback()
Public Methods
ByteArrayCronetCallback addCompletionListener(CronetRequestCompletionListener<? super byte[]> listener)
Adds a completion listener.
Protected Methods
final byte[] transformBodyBytes(UrlResponseInfo info, byte[] bodyBytes)
Transforms (deserializes) the plain full body into a user-defined object.
[Expand]
Inherited Methods
From class org.chromium.net.apihelpers.InMemoryTransformCronetCallback
From class org.chromium.net.apihelpers.ImplicitFlowControlCallback
From class org.chromium.net.UrlRequest.Callback
From class java.lang.Object

Public Constructors

public ByteArrayCronetCallback ()

Public Methods

public ByteArrayCronetCallback addCompletionListener (CronetRequestCompletionListener<? super byte[]> listener)

Adds a completion listener. All listeners are informed when the request reaches a terminal state, in order of addition. If a listener is added multiple times, it will only be called once according to the first time it was added.

Parameters
listener CronetRequestCompletionListener
Returns
ByteArrayCronetCallback

Protected Methods

protected final byte[] transformBodyBytes (UrlResponseInfo info, byte[] bodyBytes)

Transforms (deserializes) the plain full body into a user-defined object.

It is assumed that the implementing classes handle edge cases (such as empty and malformed bodies) appropriately. Cronet doesn't inspects the objects and passes them (or any exceptions) along to the issuer of the request.

Parameters
info UrlResponseInfo
bodyBytes byte
Returns
byte[]