Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 17](https://developer.android.com/sdkExtensions)

# OpenBlobForWriteResponse

*** ** * ** ***

```
class OpenBlobForWriteResponse : Closeable, Parcelable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.app.appsearch.OpenBlobForWriteResponse](https://developer.android.com/reference/kotlin/android/app/appsearch/OpenBlobForWriteResponse#) |

The response to provide batch operation results of `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSession#openBlobForWrite(kotlin.collections.MutableSet,%20java.util.concurrent.Executor,%20java.util.function.Consumer)`.

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/kotlin/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/kotlin/android/os/ParcelFileDescriptor.html#` occupies a limited file descriptor in the system.

## Summary

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` Descriptor bit used with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` Flag for use with `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

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

| Public methods ||
|---|---|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/OpenBlobForWriteResponse#close()()` Closes this stream and releases any system resources associated with it. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/OpenBlobForWriteResponse#describeContents()()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| [AppSearchBatchResult](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchBatchResult)\<[AppSearchBlobHandle](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchBlobHandle)!, [ParcelFileDescriptor](https://developer.android.com/reference/kotlin/android/os/ParcelFileDescriptor.html#)!\> | `https://developer.android.com/reference/kotlin/android/app/appsearch/OpenBlobForWriteResponse#getResult()()` Returns the `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchBatchResult` object containing the results of the write blob for write operation for each `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchBlobHandle`. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/app/appsearch/OpenBlobForWriteResponse#writeToParcel(android.os.Parcel,%20kotlin.Int)(dest: https://developer.android.com/reference/kotlin/android/os/Parcel.html#, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Flatten this object in to a Parcel. |

| Properties ||
|---|---|
| static [Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[OpenBlobForWriteResponse](https://developer.android.com/reference/kotlin/android/app/appsearch/OpenBlobForWriteResponse#)!\> | `https://developer.android.com/reference/kotlin/android/app/appsearch/OpenBlobForWriteResponse#CREATOR:android.os.Parcelable.Creator` <br /> |

## Public constructors

### OpenBlobForWriteResponse

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 17](https://developer.android.com/sdkExtensions)

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

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

| Parameters ||
|---|---|
| `result` | [AppSearchBatchResult](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchBatchResult)\<[AppSearchBlobHandle](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchBlobHandle)!, [ParcelFileDescriptor](https://developer.android.com/reference/kotlin/android/os/ParcelFileDescriptor.html#)!\>: This value cannot be `null`. |

## Public methods

### close

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
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 `https://developer.android.com/reference/kotlin/java/lang/AutoCloseable.html#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

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun describeContents(): Int
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)`, the return value of this method must include the `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` bit.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int` |

### getResult

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 17](https://developer.android.com/sdkExtensions)

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

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

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchBatchResult<https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchBlobHandle!, https://developer.android.com/reference/kotlin/android/os/ParcelFileDescriptor.html#!>` | A `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchBatchResult` maps `https://developer.android.com/reference/kotlin/android/app/appsearch/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/kotlin/android/os/ParcelFileDescriptor.html#`; if there was an error, the result contains an `https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchResult` with details of the failure. This value cannot be `null`. |

### writeToParcel

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

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

Flatten this object in to a Parcel.

| Parameters ||
|---|---|
| `dest` | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#): This value cannot be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int` |

## Properties

### CREATOR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [T Extensions 17](https://developer.android.com/sdkExtensions)

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