StrokeInputBatchSerialization


public static class StrokeInputBatchSerialization


Summary

Public methods

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

static final void
encode(
    @NonNull StrokeInputBatch strokeInputBatch,
    @NonNull OutputStream output
)

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

Public fields

INSTANCE

Added in 1.0.0-alpha05
public static @NonNull StrokeInputBatchSerialization INSTANCE

Public methods

decode

Added in 1.0.0-alpha05
public static final @NonNull ImmutableStrokeInputBatch decode(@NonNull InputStream input)

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
@NonNull InputStream input

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

Added in 1.0.0-alpha05
public static final void encode(
    @NonNull StrokeInputBatch strokeInputBatch,
    @NonNull OutputStream output
)

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