Package com.castlabs.android.network
Class Response
java.lang.Object
com.castlabs.android.network.Response
A modifiable response. You can use an instance of this class in a
ResponseModifier
to change the transformed data.- Since:
- 4.1.2
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Represents a request data type -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Request type for DRM license requestsstatic final int
Request type for DRM provisioning requestsstatic final int
Request type for other requests, such as Manifest or Media chunks.The response headersfinal int
Response code in case of HTTP.final int
The response type.final Uri
The URI of this request -
Constructor Summary
-
Method Summary
-
Field Details
-
DATA_TYPE_DRM_PROVISION
public static final int DATA_TYPE_DRM_PROVISIONRequest type for DRM provisioning requests- See Also:
-
DATA_TYPE_DRM_LICENSE
public static final int DATA_TYPE_DRM_LICENSERequest type for DRM license requests- See Also:
-
DATA_TYPE_OTHER
public static final int DATA_TYPE_OTHERRequest type for other requests, such as Manifest or Media chunks.- See Also:
-
headers
The response headers -
type
public final int typeThe response type. -
uri
The URI of this request -
responseCode
public final int responseCodeResponse code in case of HTTP. May be -1 if not available.
-
-
Constructor Details
-
Response
public Response(int type, @NonNull Uri uri, @Nullable Map<String, List<String>> headers, int code, @Nullable byte[] data) Create a new response with the given URI and headers- Parameters:
type
- The request type.uri
- The URI. Null is not permittedheaders
- The headerscode
- The response codedata
- The response data
-
-
Method Details
-
getData
@Nullable public byte[] getData()Get the data that was returned by the request- Returns:
- The data or null
-
setData
public void setData(@Nullable byte[] data) Use this to set modified response data- Parameters:
data
- The data
-