BrushFamilyExtensions

Added in 1.0.0-alpha05

public final class BrushFamilyExtensions


Summary

Public methods

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 void

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

Public methods

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

@ExperimentalInkCustomBrushApi
public static final void encode(@NonNull BrushFamily receiver, @NonNull OutputStream output)

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