# OpenBlobForWriteResponse

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

*** ** * ** ***


```
class OpenBlobForWriteResponse : Closeable
```

<br />

*** ** * ** ***

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

This class is used to retrieve the result of a batch write 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 |
|---|---|
| `const https://developer.android.com/reference/android/os/Parcelable.Creator.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/OpenBlobForWriteResponse!>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/OpenBlobForWriteResponse#CREATOR()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/OpenBlobForWriteResponse#OpenBlobForWriteResponse(androidx.appsearch.app.AppSearchBatchResult<androidx.appsearch.app.AppSearchBlobHandle,android.os.ParcelFileDescriptor>)( result: https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBatchResult<https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBlobHandle!, https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!> )` Creates a `https://developer.android.com/reference/kotlin/androidx/appsearch/app/OpenBlobForWriteResponse` with given `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBatchResult`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/OpenBlobForWriteResponse#close()()` |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBatchResult<https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBlobHandle!, https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/OpenBlobForWriteResponse#getResult()()` Returns the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBatchResult` object containing the results of the write blob for write operation for each `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBlobHandle`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/OpenBlobForWriteResponse#writeToParcel(android.os.Parcel,int)(dest: https://developer.android.com/reference/android/os/Parcel.html, flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` To be implemented by child classes. |

## Constants

### CREATOR

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

```
const val CREATOR: Parcelable.Creator<OpenBlobForWriteResponse!>
```

## Public constructors

### OpenBlobForWriteResponse

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

```
OpenBlobForWriteResponse(
    result: AppSearchBatchResult<AppSearchBlobHandle!, ParcelFileDescriptor!>
)
```

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

## Public functions

### close

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

```
fun close(): Unit
```

### getResult

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

```
fun getResult(): AppSearchBatchResult<AppSearchBlobHandle!, ParcelFileDescriptor!>
```

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

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBatchResult<https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBlobHandle!, https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!>` | A `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBatchResult` maps `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBlobHandle`s which is a unique identifier for a specific blob being committed to the outcome of that write 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/kotlin/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)

```
fun writeToParcel(dest: Parcel, flags: Int): Unit
```

To be implemented by child classes.

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