OpenBlobForReadResponse
class OpenBlobForReadResponse : Closeable, Parcelable
| kotlin.Any | |
| ↳ | android.app.appsearch.OpenBlobForReadResponse |
The response to provide batch operation results of AppSearchSession.openBlobForRead.
This class is used to retrieve the result of a batch read operation on a collection of blob handles.
The returned android.os.ParcelFileDescriptor must be closed after use to avoid resource leaks. Failing to close the descriptor will result in system resource exhaustion, as each open android.os.ParcelFileDescriptor occupies a limited file descriptor in the system.
Summary
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
|
Creates a |
|
| Public methods | |
|---|---|
| Unit |
close()Closes this stream and releases any system resources associated with it. |
| Int | |
| AppSearchBatchResult<AppSearchBlobHandle!, ParcelFileDescriptor!> |
Returns the |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<OpenBlobForReadResponse!> | |
Public constructors
OpenBlobForReadResponse
OpenBlobForReadResponse(result: AppSearchBatchResult<AppSearchBlobHandle!, ParcelFileDescriptor!>)
Creates a OpenBlobForReadResponse with given AppSearchBatchResult.
| Parameters | |
|---|---|
result |
AppSearchBatchResult<AppSearchBlobHandle!, ParcelFileDescriptor!>: This value cannot be null. |
Public methods
close
fun close(): Unit
Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.
As noted in AutoCloseable.close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.
| Exceptions | |
|---|---|
java.lang.Exception |
if this resource cannot be closed |
java.io.IOException |
if an I/O error occurs |
describeContents
fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
getResult
fun getResult(): AppSearchBatchResult<AppSearchBlobHandle!, ParcelFileDescriptor!>
Returns the AppSearchBatchResult object containing the results of the read blob for read operation for each AppSearchBlobHandle.
| Return | |
|---|---|
AppSearchBatchResult<AppSearchBlobHandle!, ParcelFileDescriptor!> |
A AppSearchBatchResult maps AppSearchBlobHandles which is a unique identifier for a specific blob being committed to the outcome of that read operation. If the operation was successful, the result for that handle is ParcelFileDescriptor; if there was an error, the result contains an AppSearchResult with details of the failure. This value cannot be null. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|
Properties
CREATOR
static val CREATOR: Parcelable.Creator<OpenBlobForReadResponse!>