# OpenBlobForReadResponse

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/OpenBlobForReadResponse.java+class:androidx.appsearch.app.OpenBlobForReadResponse) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class OpenBlobForReadResponse implements Closeable
```

<br />

*** ** * ** ***

The response to provide batch operation results of `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSession#openBlobForReadAsync(java.util.Set<androidx.appsearch.app.AppSearchBlobHandle>)`.

This class is used to retrieve the result of a batch read operation on a collection of blob handles.

The returned `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html` must be closed after use to avoid resource leaks. Failing to close the descriptor will result in system resource exhaustion, as each open `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html` occupies a limited file descriptor in the system.

## Summary

| ### Constants |
|---|---|
| `static final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Parcelable.Creator.html<https://developer.android.com/reference/androidx/appsearch/app/OpenBlobForReadResponse>` | `https://developer.android.com/reference/androidx/appsearch/app/OpenBlobForReadResponse#CREATOR()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/app/OpenBlobForReadResponse#OpenBlobForReadResponse(androidx.appsearch.app.AppSearchBatchResult<androidx.appsearch.app.AppSearchBlobHandle,android.os.ParcelFileDescriptor>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/AppSearchBatchResult<https://developer.android.com/reference/androidx/appsearch/app/AppSearchBlobHandle, https://developer.android.com/reference/android/os/ParcelFileDescriptor.html> result )` Creates a `https://developer.android.com/reference/androidx/appsearch/app/OpenBlobForReadResponse` with given `https://developer.android.com/reference/androidx/appsearch/app/AppSearchBatchResult`. |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/appsearch/app/OpenBlobForReadResponse#close()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/AppSearchBatchResult<https://developer.android.com/reference/androidx/appsearch/app/AppSearchBlobHandle, https://developer.android.com/reference/android/os/ParcelFileDescriptor.html>` | `https://developer.android.com/reference/androidx/appsearch/app/OpenBlobForReadResponse#getResult()()` Returns the `https://developer.android.com/reference/androidx/appsearch/app/AppSearchBatchResult` object containing the results of the read blob for read operation for each `https://developer.android.com/reference/androidx/appsearch/app/AppSearchBlobHandle`. |
| `void` | `https://developer.android.com/reference/androidx/appsearch/app/OpenBlobForReadResponse#writeToParcel(android.os.Parcel,int)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Parcel.html dest, int flags)` To be implemented by child classes. |

## Constants

### CREATOR

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public static final @NonNull Parcelable.Creator<OpenBlobForReadResponse> CREATOR
```

## Public constructors

### OpenBlobForReadResponse

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public OpenBlobForReadResponse(
    @NonNull AppSearchBatchResult<AppSearchBlobHandle, ParcelFileDescriptor> result
)
```

Creates a `https://developer.android.com/reference/androidx/appsearch/app/OpenBlobForReadResponse` with given `https://developer.android.com/reference/androidx/appsearch/app/AppSearchBatchResult`.

## Public methods

### close

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public void close()
```

### getResult

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public @NonNull AppSearchBatchResult<AppSearchBlobHandle, ParcelFileDescriptor> getResult()
```

Returns the `https://developer.android.com/reference/androidx/appsearch/app/AppSearchBatchResult` object containing the results of the read blob for read operation for each `https://developer.android.com/reference/androidx/appsearch/app/AppSearchBlobHandle`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/app/AppSearchBatchResult<https://developer.android.com/reference/androidx/appsearch/app/AppSearchBlobHandle, https://developer.android.com/reference/android/os/ParcelFileDescriptor.html>` | A `https://developer.android.com/reference/androidx/appsearch/app/AppSearchBatchResult` maps `https://developer.android.com/reference/androidx/appsearch/app/AppSearchBlobHandle`s 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 `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html`; if there was an error, the result contains an `https://developer.android.com/reference/androidx/appsearch/app/AppSearchResult` with details of the failure. |

### writeToParcel

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
public void writeToParcel(@NonNull Parcel dest, int flags)
```

To be implemented by child classes.

This is purely for code sync purpose. Have `writeToParcel` here so we can keep "@Override" in child classes.