# PartitionedMesh.Companion

Artifact: [androidx.ink:ink-geometry](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/geometry/PartitionedMesh.kt+class:androidx.ink.geometry.PartitionedMesh.Companion) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***


```
public static class PartitionedMesh.Companion
```

<br />

*** ** * ** ***

Declared as a target for extension functions.

## Summary

| ### Extension functions |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/PartitionedMesh` | `@https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throws/index.html(exceptionClasses = [https://developer.android.com/reference/androidx/ink/storage/IOException]) https://developer.android.com/reference/androidx/ink/geometry/PartitionedMeshExtensions.https://developer.android.com/reference/androidx/ink/geometry/PartitionedMesh.Companion#(androidx.ink.geometry.PartitionedMesh.Companion).decode(kotlin.ByteArray)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/PartitionedMesh.Companion receiver, @https://developer.android.com/reference/androidx/annotation/NonNull byte[] input )` 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/androidx/ink/geometry/PartitionedMesh`, throwing an exception if parsing or validation was not successful. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/PartitionedMesh` | `https://developer.android.com/reference/androidx/ink/geometry/PartitionedMeshExtensions.https://developer.android.com/reference/androidx/ink/geometry/PartitionedMesh.Companion#(androidx.ink.geometry.PartitionedMesh.Companion).decode(java.io.InputStream)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/PartitionedMesh.Companion receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/InputStream.html input )` 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/androidx/ink/geometry/PartitionedMesh`, throwing an exception if parsing or validation was not successful. |

## Extension functions

### PartitionedMeshExtensions.decode

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)

```
@Throws(exceptionClasses = [IOException])
public static final @NonNull PartitionedMesh PartitionedMeshExtensions.decode(
    @NonNull PartitionedMesh.Companion receiver,
    @NonNull byte[] input
)
```

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/androidx/ink/geometry/PartitionedMesh`, throwing an exception if parsing or validation was not successful.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull byte[] input` | `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/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(androidx.ink.storage.TexturePngBytesLookup)`. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/PartitionedMesh` | The `https://developer.android.com/reference/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/androidx/ink/storage/IOException` | if gzip-format bytes cannot be read from `https://developer.android.com/reference/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/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/androidx/ink/geometry/PartitionedMesh` is invalid. |

### PartitionedMeshExtensions.decode

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)

```
public static final @NonNull PartitionedMesh PartitionedMeshExtensions.decode(
    @NonNull PartitionedMesh.Companion receiver,
    @NonNull InputStream input
)
```

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/androidx/ink/geometry/PartitionedMesh`, throwing an exception if parsing or validation was not successful. Java callers should use `https://developer.android.com/reference/androidx/ink/storage/PartitionedMeshSerialization#decode(java.io.InputStream)` instead.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/InputStream.html input` | `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/androidx/ink/storage/package-summary#(androidx.ink.brush.BrushFamily).encode(java.io.OutputStream,androidx.ink.storage.TexturePngBytesLookup)`. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/geometry/PartitionedMesh` | The `https://developer.android.com/reference/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/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/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/androidx/ink/geometry/PartitionedMesh` is invalid. |