BrushFamily.Companion



Summary

Extension functions

BrushFamily?

Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, returning null if parsing was not successful.

android
BrushFamily

Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, throwing an exception if parsing was not successful.

android
BrushFamily?

Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, returning null if parsing was not successful.

android
BrushFamily

Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, throwing an exception if parsing was not successful.

android

Extension functions

decodeOrNull

@ExperimentalInkCustomBrushApi
fun BrushFamily.Companion.decodeOrNull(
    input: InputStream,
    getClientTextureId: BrushFamilyDecodeCallback
): BrushFamily?

Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, returning null if parsing was not successful. The serialized representation is gzip-compressed ink.proto.BrushFamily binary proto messages, the same as written to OutputStream by BrushFamily.encode. Java callers should use AndroidBrushFamilySerialization.decodeOrNull.

getClientTextureId is called synchronously as part of this function call, on the same thread.

decodeOrThrow

@ExperimentalInkCustomBrushApi
fun BrushFamily.Companion.decodeOrThrow(
    input: InputStream,
    getClientTextureId: BrushFamilyDecodeCallback
): BrushFamily

Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, throwing an exception if parsing was not successful. The serialized representation is gzip-compressed ink.proto.BrushFamily binary proto messages, the same as written to OutputStream by BrushFamily.encode. Java callers should use AndroidBrushFamilySerialization.decodeOrThrow.

getClientTextureId is called synchronously as part of this function call, on the same thread.

decodeOrNull

fun BrushFamily.Companion.decodeOrNull(input: InputStream): BrushFamily?

Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, returning null if parsing was not successful. The serialized representation is gzip-compressed ink.proto.BrushFamily binary proto messages, the same as written to OutputStream by BrushFamily.encode. Java callers should use BrushFamilySerialization.decodeOrNull.

decodeOrThrow

fun BrushFamily.Companion.decodeOrThrow(input: InputStream): BrushFamily

Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, throwing an exception if parsing was not successful. The serialized representation is gzip-compressed ink.proto.BrushFamily binary proto messages, the same as written to OutputStream by BrushFamily.encode. Java callers should use BrushFamilySerialization.decodeOrThrow.