StrokeInputBatchSerialization



Summary

Public functions

ImmutableStrokeInputBatch?

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

android
ImmutableStrokeInputBatch

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

android
Unit
encode(strokeInputBatch: StrokeInputBatch, output: OutputStream)

Write the gzip-compressed serialized representation of the CodedStrokeInputBatch to the given OutputStream.

android

Public functions

decodeOrNull

fun decodeOrNull(input: InputStream): ImmutableStrokeInputBatch?

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

decodeOrThrow

fun decodeOrThrow(input: InputStream): ImmutableStrokeInputBatch

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

encode

fun encode(strokeInputBatch: StrokeInputBatch, output: OutputStream): Unit

Write the gzip-compressed serialized representation of the CodedStrokeInputBatch to the given OutputStream.