AndroidBrushFamilySerialization
-
android
@ExperimentalInkCustomBrushApi
object AndroidBrushFamilySerialization
Summary
Public functions |
||
|---|---|---|
BrushFamily |
decode(input: InputStream, getClientTextureId: BrushFamilyDecodeCallback)Read a serialized |
android
|
Unit |
encode(Write a gzip-compressed |
android
|
Public functions
decode
fun decode(input: InputStream, getClientTextureId: BrushFamilyDecodeCallback): BrushFamily
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 | |
|---|---|
input: InputStream |
|
getClientTextureId: BrushFamilyDecodeCallback |
A callback to store the decoded texture image, if one were encoded inside the serialized |
| Returns | |
|---|---|
BrushFamily |
The |
| Throws | |
|---|---|
java.io.IOException |
if gzip-format bytes cannot be read from |
kotlin.IllegalArgumentException |
|
encode
fun encode(
brushFamily: BrushFamily,
output: OutputStream,
textureBitmapStore: TextureBitmapStore
): Unit
Write a gzip-compressed ink.proto.BrushFamily binary proto message representing the BrushFamily to the given OutputStream.
| Parameters | |
|---|---|
brushFamily: BrushFamily |
The |
output: OutputStream |
The |
textureBitmapStore: TextureBitmapStore |
The |