StrokeInputBatchSerialization



Summary

Public functions

ImmutableStrokeInputBatch

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

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

Write a gzip-compressed ink.proto.CodedStrokeInputBatch binary proto message representing the StrokeInputBatch to the given OutputStream.

android

Public functions

decode

fun decode(input: InputStream): ImmutableStrokeInputBatch

Read a serialized CodedStrokeInputBatch from the given InputStream and parse it into a ImmutableStrokeInputBatch, throwing an exception if parsing or validation was not successful. Kotlin callers should use StrokeInputBatch.Companion.decode instead.

Parameters
input: InputStream

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

Throws
java.io.IOException

if gzip-format bytes cannot be read from input.

kotlin.IllegalArgumentException

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

encode

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

Write a gzip-compressed ink.proto.CodedStrokeInputBatch binary proto message representing the StrokeInputBatch to the given OutputStream.