androidx.ink.storage
Top-level functions summary
ImmutableStrokeInputBatch? |
decodeOrNull(input: InputStream) Read a serialized CodedStrokeInputBatch from the given |
ImmutableStrokeInputBatch |
decodeOrThrow(input: InputStream) Read a serialized CodedStrokeInputBatch from the given |
Extension functions summary
ImmutableStrokeInputBatch? |
Read a serialized CodedStrokeInputBatch from the given |
ImmutableStrokeInputBatch |
Read a serialized CodedStrokeInputBatch from the given |
Unit |
StrokeInputBatch.encode(output: OutputStream) Write the gzip-compressed serialized representation of the CodedStrokeInputBatch to the given |
Top-level functions
decodeOrNull
fun decodeOrNull(input: InputStream): ImmutableStrokeInputBatch?
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.
decodeOrThrow
fun decodeOrThrow(input: InputStream): ImmutableStrokeInputBatch
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.
Extension functions
decodeOrNull
fun StrokeInputBatch.Companion.decodeOrNull(input: InputStream): ImmutableStrokeInputBatch?
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
fun StrokeInputBatch.Companion.decodeOrThrow(input: InputStream): ImmutableStrokeInputBatch
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.
encode
fun StrokeInputBatch.encode(output: OutputStream): Unit
Write the gzip-compressed serialized representation of the CodedStrokeInputBatch to the given OutputStream
.