StrokeInputBatchExtensions

Added in 1.0.0

public final class StrokeInputBatchExtensions


Summary

Public methods

static final @NonNull ImmutableStrokeInputBatch
@Throws(exceptionClasses = [IOException])
decode(@NonNull StrokeInputBatch.Companion receiver, @NonNull byte[] input)

Read a serialized gzip-compressed ink.proto.CodedStrokeInputBatch from the given ByteArray and parse it into a ImmutableStrokeInputBatch, throwing an exception if parsing or validation was not successful.

static final @NonNull ImmutableStrokeInputBatch
decode(
    @NonNull StrokeInputBatch.Companion receiver,
    @NonNull InputStream input
)

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

static final @NonNull byte[]

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

static final void

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

Public methods

@Throws(exceptionClasses = [IOException])
public static final @NonNull ImmutableStrokeInputBatch decode(@NonNull StrokeInputBatch.Companion receiver, @NonNull byte[] input)

Read a serialized gzip-compressed ink.proto.CodedStrokeInputBatch from the given ByteArray and parse it into a ImmutableStrokeInputBatch, throwing an exception if parsing or validation was not successful.

Parameters
@NonNull byte[] input

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

Throws
IOException

if gzip-format bytes cannot be read from input.

IllegalArgumentException

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

decode

public static final @NonNull ImmutableStrokeInputBatch decode(
    @NonNull StrokeInputBatch.Companion receiver,
    @NonNull InputStream input
)

Read a serialized gzip-compressed ink.proto.CodedStrokeInputBatch from the given InputStream and parse it into a ImmutableStrokeInputBatch, throwing an exception if parsing or validation was not successful. Java callers should use StrokeInputBatchSerialization.decode instead.

Parameters
@NonNull InputStream input

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

Throws
java.io.IOException

if gzip-format bytes cannot be read from input.

IllegalArgumentException

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

public static final @NonNull byte[] encode(@NonNull StrokeInputBatch receiver)

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

encode

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

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