AndroidBrushFamilySerialization
@ExperimentalInkCustomBrushApi
public static class AndroidBrushFamilySerialization
Summary
Public fields |
|
|---|---|
static @NonNull AndroidBrushFamilySerialization |
Public methods |
|
|---|---|
static final @NonNull BrushFamily |
decode(Read a serialized |
static final void |
encode(Write a gzip-compressed |
Public fields
Public methods
decode
public static final @NonNull BrushFamily decode(
@NonNull InputStream input,
@NonNull BrushFamilyDecodeCallback getClientTextureId
)
Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, throwing an exception if parsing or validation was not successful. Kotlin callers should use BrushFamily.Companion.decode instead.
getClientTextureId is called synchronously as part of this function call, on the same thread.
| Parameters | |
|---|---|
@NonNull InputStream input |
|
@NonNull BrushFamilyDecodeCallback getClientTextureId |
A callback to store the decoded texture image, if one were encoded inside the serialized |
| Returns | |
|---|---|
@NonNull BrushFamily |
The |
| Throws | |
|---|---|
java.io.IOException |
if gzip-format bytes cannot be read from |
kotlin.IllegalArgumentException |
|
encode
public static final void encode(
@NonNull BrushFamily brushFamily,
@NonNull OutputStream output,
@NonNull TextureBitmapStore textureBitmapStore
)
Write a gzip-compressed ink.proto.BrushFamily binary proto message representing the BrushFamily to the given OutputStream.
| Parameters | |
|---|---|
@NonNull BrushFamily brushFamily |
The |
@NonNull OutputStream output |
The |
@NonNull TextureBitmapStore textureBitmapStore |
The |