StrokeInputBatchSerialization

Added in 1.0.0-alpha03

public final 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 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 @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

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

Public methods

decodeOrNull

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 StrokeInputBatch.encode. Kotlin callers should use StrokeInputBatch.Companion.decodeOrNull instead.

decodeOrNull

public static final ImmutableStrokeInputBatch decodeOrNull(
    @NonNull StrokeInputBatch.Companion receiver,
    @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 StrokeInputBatch.encode. Java callers should use StrokeInputBatchSerialization.decodeStrokeInputBatchOrNull.

decodeOrThrow

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 StrokeInputBatch.encode. Kotlin callers should use StrokeInputBatch.Companion.decodeOrThrow instead.

decodeOrThrow

public static final @NonNull ImmutableStrokeInputBatch decodeOrThrow(
    @NonNull StrokeInputBatch.Companion receiver,
    @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 StrokeInputBatch.encode. Java callers should use StrokeInputBatchSerialization.decodeStrokeInputBatchOrThrow.

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

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