StrokeInputBatchSerialization


public static class StrokeInputBatchSerialization


Summary

Public methods

static final ImmutableStrokeInputBatch

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

static final @NonNull ImmutableStrokeInputBatch

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

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

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

Public fields

INSTANCE

Added in 1.0.0-alpha04
public static @NonNull StrokeInputBatchSerialization INSTANCE

Public methods

decodeOrNull

Added in 1.0.0-alpha04
public static final ImmutableStrokeInputBatch decodeOrNull(@NonNull InputStream input)

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

Added in 1.0.0-alpha04
public static final @NonNull ImmutableStrokeInputBatch decodeOrThrow(@NonNull InputStream input)

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

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

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