BrushFamily.Companion


public static class BrushFamily.Companion


Summary

Extension functions

static final @NonNull 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.

static final @NonNull 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.

Extension functions

AndroidBrushFamilyExtensions.decode

@ExperimentalInkCustomBrushApi
public static final @NonNull BrushFamily AndroidBrushFamilyExtensions.decode(
    @NonNull BrushFamily.Companion receiver,
    @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. Java callers should use AndroidBrushFamilySerialization.decode instead.

Parameters
@NonNull InputStream input

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

@NonNull BrushFamilyDecodeCallback getClientTextureId

A callback to store the decoded texture image, if one were encoded inside the serialized BrushFamily, into a TextureBitmapStore. This is called synchronously as part of this function call on the same thread.

Returns
@NonNull 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.

BrushFamilyExtensions.decode

@ExperimentalInkCustomBrushApi
public static final @NonNull BrushFamily BrushFamilyExtensions.decode(
    @NonNull BrushFamily.Companion receiver,
    @NonNull InputStream input
)

Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, throwing an exception if parsing or validation was not successful. Java callers should use BrushFamilySerialization.decode instead.

Parameters
@NonNull InputStream input

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

Returns
@NonNull 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.