BrushFamilySerialization



Summary

Public functions

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.

android
Unit
encode(brushFamily: BrushFamily, output: OutputStream)

Write a gzip-compressed serialized ink.proto.BrushFamily proto message representing the BrushFamily to the given OutputStream.

android

Public functions

decode

fun decode(input: InputStream): 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.

Parameters
input: InputStream

InputStream providing gzip-compressed ink.proto.BrushFamily binary proto messages, the same as written to OutputStream by encode.

Returns
BrushFamily

The BrushFamily parsed from the InputStream.

Throws
java.io.IOException

if gzip-format bytes cannot be read from input.

kotlin.IllegalArgumentException

input does not provide a valid ink.proto.BrushFamily proto message, or the corresponding BrushFamily is invalid.

encode

fun encode(brushFamily: BrushFamily, output: OutputStream): Unit

Write a gzip-compressed serialized ink.proto.BrushFamily proto message representing the BrushFamily to the given OutputStream.