StrokeInputBatchSerialization
-
android
object StrokeInputBatchSerialization
Summary
Public functions |
||
|---|---|---|
ImmutableStrokeInputBatch |
Read a serialized gzip-compressed |
android
|
ImmutableStrokeInputBatch |
decode(input: InputStream)Read a serialized gzip-compressed |
android
|
ByteArray |
encode(strokeInputBatch: StrokeInputBatch)Write a gzip-compressed |
android
|
Unit |
encode(strokeInputBatch: StrokeInputBatch, output: OutputStream)Write a gzip-compressed |
android
|
Public functions
decode
fun decode(input: ByteArray): ImmutableStrokeInputBatch
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. Kotlin callers should use StrokeInputBatch.Companion.decode instead.
| Parameters | |
|---|---|
input: ByteArray |
|
| Returns | |
|---|---|
ImmutableStrokeInputBatch |
The |
| Throws | |
|---|---|
IllegalArgumentException |
|
decode
fun decode(input: InputStream): ImmutableStrokeInputBatch
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. Kotlin callers should use StrokeInputBatch.Companion.decode instead.
| Parameters | |
|---|---|
input: InputStream |
|
| Returns | |
|---|---|
ImmutableStrokeInputBatch |
The |
| Throws | |
|---|---|
java.io.IOException |
if gzip-format bytes cannot be read from |
IllegalArgumentException |
|
encode
fun encode(strokeInputBatch: StrokeInputBatch): ByteArray
Write a gzip-compressed ink.proto.CodedStrokeInputBatch binary proto message representing the StrokeInputBatch to a ByteArray. Kotlin callers should use StrokeInputBatch.encode instead.
encode
fun encode(strokeInputBatch: StrokeInputBatch, output: OutputStream): Unit
Write a gzip-compressed ink.proto.CodedStrokeInputBatch binary proto message representing the StrokeInputBatch to the given OutputStream. Kotlin callers should use StrokeInputBatch.encode instead.