# androidx.ink.storage

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOS

## Interfaces

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/BrushFamilyDecodeCallback` | A callback to use with `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.BrushFamilyDecodeCallback)` to manage texture image assets. | android |
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTexturePngBytes` |   | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTextureUiImage` | A callback to use with `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTextureUiImage)` to manage texture image assets. | N |
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/TexturePngBytesLookup` |   | Cmn |

## Exceptions

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/IOException` |   | Cmn android N |

## Objects

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/AndroidBrushFamilySerialization` |   | android |
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/BrushFamilySerialization` |   | android |
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/PartitionedMeshSerialization` |   | android |
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/StrokeInputBatchSerialization` |   | android |

## Type aliases

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/IOException` |   | android N |

## Extension functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` | `@https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throws/index.html(exceptionClasses = [https://developer.android.com/reference/kotlin/androidx/ink/storage/IOException]) https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.geometry.PartitionedMesh.Companion).decode(kotlin.ByteArray)(input: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html)` Read a serialized gzip-compressed `ink.proto.CodedModeledShape` from the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh`, throwing an exception if parsing or validation was not successful. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch` | `@https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throws/index.html(exceptionClasses = [https://developer.android.com/reference/kotlin/androidx/ink/storage/IOException]) https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.strokes.StrokeInputBatch.Companion).decode(kotlin.ByteArray)(input: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html)` Read a serialized gzip-compressed `ink.proto.CodedStrokeInputBatch` from the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch`, throwing an exception if parsing or validation was not successful. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.geometry.PartitionedMesh.Companion).decode(java.io.InputStream)(input: https://developer.android.com/reference/java/io/InputStream.html)` Read a serialized gzip-compressed `ink.proto.CodedModeledShape` from the given `https://developer.android.com/reference/java/io/InputStream.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh`, throwing an exception if parsing or validation was not successful. | android |
| `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch` | `https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.strokes.StrokeInputBatch.Companion).decode(java.io.InputStream)(input: https://developer.android.com/reference/java/io/InputStream.html)` Read a serialized gzip-compressed `ink.proto.CodedStrokeInputBatch` from the given `https://developer.android.com/reference/java/io/InputStream.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch`, throwing an exception if parsing or validation was not successful. | android |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.storage.OnDecodeTextureUiImage)( input: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html, onDecodeTexture: https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTextureUiImage )` See `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.storage.OnDecodeTextureUiImage)` above. | N |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.storage.BrushFamilyDecodeCallback)( input: https://developer.android.com/reference/java/io/InputStream.html, getClientTextureId: https://developer.android.com/reference/kotlin/androidx/ink/storage/BrushFamilyDecodeCallback )` See `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.storage.BrushFamilyDecodeCallback)` above. | android |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | `@https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throws/index.html(exceptionClasses = [https://developer.android.com/reference/kotlin/androidx/ink/storage/IOException]) https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTexturePngBytes)( input: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html, maxVersion: https://developer.android.com/reference/kotlin/androidx/ink/brush/Version, onDecodeTexture: https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTexturePngBytes? )` Read a serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` from the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, throwing an exception if parsing or validation was not successful. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTextureUiImage)( input: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html, maxVersion: https://developer.android.com/reference/kotlin/androidx/ink/brush/Version, onDecodeTexture: https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTextureUiImage )` Read a serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` from the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, throwing an exception if parsing or validation was not successful. | N |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.BrushFamilyDecodeCallback)( input: https://developer.android.com/reference/java/io/InputStream.html, maxVersion: https://developer.android.com/reference/kotlin/androidx/ink/brush/Version, getClientTextureId: https://developer.android.com/reference/kotlin/androidx/ink/storage/BrushFamilyDecodeCallback )` Read a serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` from the given `https://developer.android.com/reference/java/io/InputStream.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, throwing an exception if parsing or validation was not successful. | android |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.Companion.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTexturePngBytes)( input: https://developer.android.com/reference/java/io/InputStream.html, maxVersion: https://developer.android.com/reference/kotlin/androidx/ink/brush/Version, onDecodeTexture: https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTexturePngBytes? )` Read a serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` from the given `https://developer.android.com/reference/java/io/InputStream.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, throwing an exception if parsing or validation was not successful. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.geometry.PartitionedMesh).encode()()` Write a gzip-compressed `ink.proto.CodedModeledShape` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` to the returned `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.strokes.StrokeInputBatch).encode()()` Write a gzip-compressed `ink.proto.CodedStrokeInputBatch` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch` to the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.geometry.PartitionedMesh).encode(java.io.OutputStream)(output: https://developer.android.com/reference/java/io/OutputStream.html)` Write a gzip-compressed `ink.proto.CodedModeledShape` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` to the given `https://developer.android.com/reference/java/io/OutputStream.html`. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.strokes.StrokeInputBatch).encode(java.io.OutputStream)(output: https://developer.android.com/reference/java/io/OutputStream.html)` Write a gzip-compressed `ink.proto.CodedStrokeInputBatch` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch` to the given `https://developer.android.com/reference/java/io/OutputStream.html`. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(androidx.ink.storage.TexturePngBytesLookup)(textureIdToPngBytes: https://developer.android.com/reference/kotlin/androidx/ink/storage/TexturePngBytesLookup?)` Write a gzip-compressed `ink.proto.BrushFamily` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` to the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` using the provided callback to retrieve texture PNG bytes. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(androidx.ink.brush.TextureImageStore)(textureImageStore: https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureImageStore)` Return a gzip-compressed `ink.proto.BrushFamily` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` as a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`. | N |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(java.io.OutputStream,androidx.ink.brush.TextureBitmapStore)( output: https://developer.android.com/reference/java/io/OutputStream.html, textureBitmapStore: https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureBitmapStore )` Write a gzip-compressed `ink.proto.BrushFamily` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` to the given `https://developer.android.com/reference/java/io/OutputStream.html`. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily.https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(java.io.OutputStream,androidx.ink.storage.TexturePngBytesLookup)( output: https://developer.android.com/reference/java/io/OutputStream.html, textureIdToPngBytes: https://developer.android.com/reference/kotlin/androidx/ink/storage/TexturePngBytesLookup? )` Write a gzip-compressed serialized `ink.proto.BrushFamily` proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` to the given `https://developer.android.com/reference/java/io/OutputStream.html`. | android |

## Extension functions

### PartitionedMesh.Companion.decode

Cmn Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/PartitionedMeshExtensions.kt+function:decode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
@Throws(exceptionClasses = [IOException])
fun PartitionedMesh.Companion.decode(input: ByteArray): PartitionedMesh
```

Read a serialized gzip-compressed `ink.proto.CodedModeledShape` from the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh`, throwing an exception if parsing or validation was not successful.

| Parameters |
|---|---|
| `input: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` providing gzip-compressed `ink.proto.CodedModeledShape` binary proto messages, the same as written by `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(androidx.ink.storage.TexturePngBytesLookup)`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` | The `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` parsed from the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/IOException` | if gzip-format bytes cannot be read from `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.geometry.PartitionedMesh.Companion).decode(kotlin.ByteArray)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.geometry.PartitionedMesh.Companion).decode(kotlin.ByteArray)` does not provide a valid `ink.proto.CodedModeledShape` proto message, or the corresponding `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` is invalid. |

### StrokeInputBatch.Companion.decode

Cmn Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/StrokeInputBatchExtensions.kt+function:decode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
@Throws(exceptionClasses = [IOException])
fun StrokeInputBatch.Companion.decode(input: ByteArray): ImmutableStrokeInputBatch
```

Read a serialized gzip-compressed `ink.proto.CodedStrokeInputBatch` from the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch`, throwing an exception if parsing or validation was not successful.

| Parameters |
|---|---|
| `input: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` providing gzip-compressed `ink.proto.CodedStrokeInputBatch` binary proto messages, the same as written by `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(androidx.ink.storage.TexturePngBytesLookup)`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch` | The `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch` parsed from the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/IOException` | if gzip-format bytes cannot be read from `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.strokes.StrokeInputBatch.Companion).decode(kotlin.ByteArray)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.strokes.StrokeInputBatch.Companion).decode(kotlin.ByteArray)` does not provide a valid `ink.proto.CodedStrokeInputBatch` proto message, or the corresponding `https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch` is invalid. |

### PartitionedMesh.Companion.decode

android Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/PartitionedMeshExtensions.jvmAndAndroid.kt+function:decode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun PartitionedMesh.Companion.decode(input: InputStream): PartitionedMesh
```

Read a serialized gzip-compressed `ink.proto.CodedModeledShape` from the given `https://developer.android.com/reference/java/io/InputStream.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh`, throwing an exception if parsing or validation was not successful. Java callers should use `https://developer.android.com/reference/kotlin/androidx/ink/storage/PartitionedMeshSerialization#decode(java.io.InputStream)` instead.

| Parameters |
|---|---|
| `input: https://developer.android.com/reference/java/io/InputStream.html` | `https://developer.android.com/reference/java/io/InputStream.html` providing gzip-compressed `ink.proto.CodedModeledShape` binary proto messages, the same as written by `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(java.io.OutputStream,androidx.ink.storage.TexturePngBytesLookup)`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` | The `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` parsed from the `https://developer.android.com/reference/java/io/InputStream.html`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | if gzip-format bytes cannot be read from `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.geometry.PartitionedMesh.Companion).decode(java.io.InputStream)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.geometry.PartitionedMesh.Companion).decode(java.io.InputStream)` does not provide a valid `ink.proto.CodedModeledShape` proto message, or the corresponding `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` is invalid. |

### StrokeInputBatch.Companion.decode

android Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/StrokeInputBatchExtensions.jvmAndAndroid.kt+function:decode) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
fun StrokeInputBatch.Companion.decode(input: InputStream): ImmutableStrokeInputBatch
```

Read a serialized gzip-compressed `ink.proto.CodedStrokeInputBatch` from the given `https://developer.android.com/reference/java/io/InputStream.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch`, throwing an exception if parsing or validation was not successful. Java callers should use `https://developer.android.com/reference/kotlin/androidx/ink/storage/StrokeInputBatchSerialization#decode(java.io.InputStream)` instead.

| Parameters |
|---|---|
| `input: https://developer.android.com/reference/java/io/InputStream.html` | `https://developer.android.com/reference/java/io/InputStream.html` providing gzip-compressed `ink.proto.CodedStrokeInputBatch` binary proto messages, the same as written by `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(java.io.OutputStream,androidx.ink.storage.TexturePngBytesLookup)`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch` | The `https://developer.android.com/reference/kotlin/androidx/ink/strokes/ImmutableStrokeInputBatch` parsed from the `https://developer.android.com/reference/java/io/InputStream.html`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | if gzip-format bytes cannot be read from `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.strokes.StrokeInputBatch.Companion).decode(java.io.InputStream)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.strokes.StrokeInputBatch.Companion).decode(java.io.InputStream)` does not provide a valid `ink.proto.CodedStrokeInputBatch` proto message, or the corresponding `https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch` is invalid. |

### BrushFamily.Companion.decode

N Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/IosBrushFamilyExtensions.ios.kt+function:decode)

```
fun BrushFamily.Companion.decode(
    input: ByteArray,
    onDecodeTexture: OnDecodeTextureUiImage
): BrushFamily
```

See `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.storage.OnDecodeTextureUiImage)` above. This overload uses `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version#MAX_SUPPORTED()`.

### BrushFamily.Companion.decode

android Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/AndroidBrushFamilyExtensions.android.kt+function:decode) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
fun BrushFamily.Companion.decode(
    input: InputStream,
    getClientTextureId: BrushFamilyDecodeCallback
): BrushFamily
```

See `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.storage.BrushFamilyDecodeCallback)` above. This overload uses `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version#MAX_SUPPORTED()`.

### BrushFamily.Companion.decode

Cmn Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/BrushFamilyExtensions.kt+function:decode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
@Throws(exceptionClasses = [IOException])
fun BrushFamily.Companion.decode(
    input: ByteArray,
    maxVersion: Version = Version.MAX_SUPPORTED,
    onDecodeTexture: OnDecodeTexturePngBytes? = null
): BrushFamily
```

Read a serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` from the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, throwing an exception if parsing or validation was not successful.

| Parameters |
|---|---|
| `input: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` providing gzip-compressed `ink.proto.BrushFamily` binary proto messages, the same as written by `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(androidx.ink.storage.TexturePngBytesLookup)`. |
| `maxVersion: https://developer.android.com/reference/kotlin/androidx/ink/brush/Version = Version.MAX_SUPPORTED` | The maximum `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` supported by the deserializer. Proto objects with a `min_version` of greater than maxVersion will be rejected. |
| `onDecodeTexture: https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTexturePngBytes? = null` | A callback to store any decoded texture image, if any were encoded inside the serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`. This is called synchronously as part of this function call, on the same thread, once for each texture image. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | The `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` parsed from the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTexturePngBytes)` does not provide a valid `ink.proto.BrushFamily` proto message, or the corresponding `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` is invalid. |
| `https://developer.android.com/reference/kotlin/androidx/ink/storage/IOException` | if gzip-format bytes cannot be read from `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTexturePngBytes)`. |

### BrushFamily.Companion.decode

N Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/IosBrushFamilyExtensions.ios.kt+function:decode)

```
fun BrushFamily.Companion.decode(
    input: ByteArray,
    maxVersion: Version,
    onDecodeTexture: OnDecodeTextureUiImage
): BrushFamily
```

Read a serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` from the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, throwing an exception if parsing or validation was not successful.

| Parameters |
|---|---|
| `input: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` providing gzip-compressed `ink.proto.BrushFamily` binary proto messages, the same as written by `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(androidx.ink.brush.TextureImageStore)`. |
| `maxVersion: https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` | The maximum `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` to be supported by the deserializer. Proto objects with a `min_version` of greater than maxVersion will be rejected. |
| `onDecodeTexture: https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTextureUiImage` | A callback to store the decoded texture image, if one were encoded inside the serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureImageStore`. This is called synchronously as part of this function call on the same thread. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | The `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` parsed from the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`. |

| Throws |
|---|---|
| `https://lysine.dev/okio/3.x/okio/okio/-i-o-exception/index.html` | if gzip-format bytes cannot be read from `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTextureUiImage)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(kotlin.ByteArray,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTextureUiImage)` does not provide a valid `ink.proto.BrushFamily` proto message, or the corresponding `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` is invalid. |

### BrushFamily.Companion.decode

android Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/AndroidBrushFamilyExtensions.android.kt+function:decode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun BrushFamily.Companion.decode(
    input: InputStream,
    maxVersion: Version,
    getClientTextureId: BrushFamilyDecodeCallback
): BrushFamily
```

Read a serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` from the given `https://developer.android.com/reference/java/io/InputStream.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, throwing an exception if parsing or validation was not successful. Java callers should use `https://developer.android.com/reference/kotlin/androidx/ink/storage/AndroidBrushFamilySerialization#decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.BrushFamilyDecodeCallback)` instead.

| Parameters |
|---|---|
| `input: https://developer.android.com/reference/java/io/InputStream.html` | `https://developer.android.com/reference/java/io/InputStream.html` providing gzip-compressed `ink.proto.BrushFamily` binary proto messages, the same as written to `https://developer.android.com/reference/java/io/OutputStream.html` by `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(java.io.OutputStream,androidx.ink.brush.TextureBitmapStore)`. |
| `maxVersion: https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` | The maximum `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` to be supported by the deserializer. Proto objects with a `min_version` of greater than maxVersion will be rejected. |
| `getClientTextureId: https://developer.android.com/reference/kotlin/androidx/ink/storage/BrushFamilyDecodeCallback` | A callback to store the decoded texture image, if one were encoded inside the serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureBitmapStore`. This is called synchronously as part of this function call on the same thread. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | The `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` parsed from the `https://developer.android.com/reference/java/io/InputStream.html`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | if gzip-format bytes cannot be read from `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.BrushFamilyDecodeCallback)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.BrushFamilyDecodeCallback)` does not provide a valid `ink.proto.BrushFamily` proto message, or the corresponding `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` is invalid. |

### BrushFamily.Companion.decode

android Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/BrushFamilyExtensions.jvmAndAndroid.kt+function:decode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun BrushFamily.Companion.decode(
    input: InputStream,
    maxVersion: Version = Version.MAX_SUPPORTED,
    onDecodeTexture: OnDecodeTexturePngBytes? = null
): BrushFamily
```

Read a serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` from the given `https://developer.android.com/reference/java/io/InputStream.html` and parse it into a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`, throwing an exception if parsing or validation was not successful. Java callers should use `https://developer.android.com/reference/kotlin/androidx/ink/storage/BrushFamilySerialization#decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTexturePngBytes)` instead.

| Parameters |
|---|---|
| `input: https://developer.android.com/reference/java/io/InputStream.html` | `https://developer.android.com/reference/java/io/InputStream.html` providing gzip-compressed `ink.proto.BrushFamily` binary proto messages, the same as written by `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(java.io.OutputStream,androidx.ink.storage.TexturePngBytesLookup)`. |
| `maxVersion: https://developer.android.com/reference/kotlin/androidx/ink/brush/Version = Version.MAX_SUPPORTED` | The maximum `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` supported by the deserializer. Proto objects with a `min_version` of greater than maxVersion will be rejected. |
| `onDecodeTexture: https://developer.android.com/reference/kotlin/androidx/ink/storage/OnDecodeTexturePngBytes? = null` | A callback to store any decoded texture image, if any were encoded inside the serialized `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`. This is called synchronously as part of this function call, on the same thread, once for each texture image. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | The `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` parsed from the `https://developer.android.com/reference/java/io/InputStream.html`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | if gzip-format bytes cannot be read from `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTexturePngBytes)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily.Companion).decode(java.io.InputStream,androidx.ink.brush.Version,androidx.ink.storage.OnDecodeTexturePngBytes)` does not provide a valid `ink.proto.BrushFamily` proto message, or the corresponding `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` is invalid. |

### PartitionedMesh.encode

Cmn Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/PartitionedMeshExtensions.kt+function:encode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun PartitionedMesh.encode(): ByteArray
```

Write a gzip-compressed `ink.proto.CodedModeledShape` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` to the returned `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`.

### StrokeInputBatch.encode

Cmn Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/StrokeInputBatchExtensions.kt+function:encode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun StrokeInputBatch.encode(): ByteArray
```

Write a gzip-compressed `ink.proto.CodedStrokeInputBatch` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch` to the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`.

### PartitionedMesh.encode

android Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/PartitionedMeshExtensions.jvmAndAndroid.kt+function:encode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun PartitionedMesh.encode(output: OutputStream): Unit
```

Write a gzip-compressed `ink.proto.CodedModeledShape` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/PartitionedMesh` to the given `https://developer.android.com/reference/java/io/OutputStream.html`.

### StrokeInputBatch.encode

android Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/StrokeInputBatchExtensions.jvmAndAndroid.kt+function:encode) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
fun StrokeInputBatch.encode(output: OutputStream): Unit
```

Write a gzip-compressed `ink.proto.CodedStrokeInputBatch` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/strokes/StrokeInputBatch` to the given `https://developer.android.com/reference/java/io/OutputStream.html`.

### BrushFamily.encode

Cmn Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/BrushFamilyExtensions.kt+function:encode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun BrushFamily.encode(textureIdToPngBytes: TexturePngBytesLookup? = null): ByteArray
```

Write a gzip-compressed `ink.proto.BrushFamily` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` to the given `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html` using the provided callback to retrieve texture PNG bytes. If `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily#hasFallbacks()` is true, then the stored proto message including fallbacks for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` will be used instead of recomputing the proto from the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` object.

| Parameters |
|---|---|
| `textureIdToPngBytes: https://developer.android.com/reference/kotlin/androidx/ink/storage/TexturePngBytesLookup? = null` | A callback to retrieve the PNG bytes of the texture bitmap for a given client texture ID. |

### BrushFamily.encode

N Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/IosBrushFamilyExtensions.ios.kt+function:encode)

```
fun BrushFamily.encode(textureImageStore: TextureImageStore): ByteArray
```

Return a gzip-compressed `ink.proto.BrushFamily` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` as a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html`. If `hasFallbacks` is true, then the stored proto message including fallbacks for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` will be used instead of recomputing the proto from the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` object.

| Parameters |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | The `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` object to encode. |
| `textureImageStore: https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureImageStore` | The `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureImageStore` to use to encode the texture images within the encoded `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`. If this is not desired behavior, e.g. if the application has a static set of texture images that it includes as resources, then this can be a `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureImageStore` that always returns `null`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | If a is returned from the `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureImageStore` but it cannot be encoded to PNG. |

### BrushFamily.encode

android Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/AndroidBrushFamilyExtensions.android.kt+function:encode) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
fun BrushFamily.encode(
    output: OutputStream,
    textureBitmapStore: TextureBitmapStore
): Unit
```

Write a gzip-compressed `ink.proto.BrushFamily` binary proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` to the given `https://developer.android.com/reference/java/io/OutputStream.html`. If `hasFallbacks` is true, then the stored, proto message including fallbacks for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` will be used instead of recomputing the proto from the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` object.

| Parameters |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` | The `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` object to encode. |
| `output: https://developer.android.com/reference/java/io/OutputStream.html` | The `https://developer.android.com/reference/java/io/OutputStream.html` to write the gzip-compressed encoded bytes to. |
| `textureBitmapStore: https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureBitmapStore` | The `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureBitmapStore` to use to encode the texture images within the encoded `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily`. If this is not desired behavior, e.g. if the application has a static set of texture images that it includes as resources, then this can be a `https://developer.android.com/reference/kotlin/androidx/ink/brush/TextureBitmapStore` that always returns `null`. |

### BrushFamily.encode

android Artifact: [androidx.ink:ink-storage](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/storage/BrushFamilyExtensions.jvmAndAndroid.kt+function:encode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun BrushFamily.encode(
    output: OutputStream,
    textureIdToPngBytes: TexturePngBytesLookup? = null
): Unit
```

Write a gzip-compressed serialized `ink.proto.BrushFamily` proto message representing the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` to the given `https://developer.android.com/reference/java/io/OutputStream.html`. If `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily#hasFallbacks()` is true, then the stored proto message including fallbacks for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` will be used instead of recomputing the proto from the `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` object.