androidx.ink.storage
Interfaces
BrushFamilyDecodeCallback |
A callback to use with |
android
|
OnDecodeTexturePngBytes |
Cmn
|
|
TexturePngBytesLookup |
Cmn
|
Exceptions
IOException |
Cmn
android
N
|
Objects
AndroidBrushFamilySerialization |
android
|
|
BrushFamilySerialization |
android
|
|
StrokeInputBatchSerialization |
android
|
Type aliases
IOException |
android
N
|
Extension functions summary
ImmutableStrokeInputBatch |
@Throws(exceptionClasses = [IOException])Read a serialized gzip-compressed |
Cmn
|
ImmutableStrokeInputBatch |
Read a serialized gzip-compressed |
android
|
BrushFamily |
BrushFamily.Companion.decode(See |
android
|
BrushFamily |
@Throws(exceptionClasses = [IOException])Read a serialized |
Cmn
|
BrushFamily |
BrushFamily.Companion.decode(Read a serialized |
android
|
BrushFamily |
BrushFamily.Companion.decode(Read a serialized |
android
|
ByteArray |
Write a gzip-compressed |
Cmn
|
Unit |
StrokeInputBatch.encode(output: OutputStream)Write a gzip-compressed |
android
|
ByteArray |
BrushFamily.encode(textureIdToPngBytes: TexturePngBytesLookup?)Write a gzip-compressed |
Cmn
|
Unit |
BrushFamily.encode(Write a gzip-compressed |
android
|
Unit |
BrushFamily.encode(Write a gzip-compressed serialized |
android
|
Extension functions
StrokeInputBatch.Companion.decode
@Throws(exceptionClasses = [IOException])
fun StrokeInputBatch.Companion.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.
| Parameters | |
|---|---|
input: ByteArray |
|
| Returns | |
|---|---|
ImmutableStrokeInputBatch |
The |
| Throws | |
|---|---|
IOException |
if gzip-format bytes cannot be read from |
IllegalArgumentException |
|
StrokeInputBatch.Companion.decode
fun StrokeInputBatch.Companion.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. Java callers should use StrokeInputBatchSerialization.decode instead.
| Parameters | |
|---|---|
input: InputStream |
|
| Returns | |
|---|---|
ImmutableStrokeInputBatch |
The |
| Throws | |
|---|---|
java.io.IOException |
if gzip-format bytes cannot be read from |
IllegalArgumentException |
|
BrushFamily.Companion.decode
fun BrushFamily.Companion.decode(
input: InputStream,
getClientTextureId: BrushFamilyDecodeCallback
): BrushFamily
See decode above. This overload uses Version.MAX_SUPPORTED.
BrushFamily.Companion.decode
@Throws(exceptionClasses = [IOException])
fun BrushFamily.Companion.decode(
input: ByteArray,
maxVersion: Version = Version.MAX_SUPPORTED,
onDecodeTexture: OnDecodeTexturePngBytes? = null
): BrushFamily
Read a serialized BrushFamily from the given ByteArray and parse it into a BrushFamily, throwing an exception if parsing or validation was not successful.
| Parameters | |
|---|---|
input: ByteArray |
|
maxVersion: Version = Version.MAX_SUPPORTED |
The maximum |
onDecodeTexture: OnDecodeTexturePngBytes? = null |
A callback to store any decoded texture image, if any were encoded inside the serialized |
| Returns | |
|---|---|
BrushFamily |
The |
| Throws | |
|---|---|
IllegalArgumentException |
|
IOException |
if gzip-format bytes cannot be read from |
BrushFamily.Companion.decode
fun BrushFamily.Companion.decode(
input: InputStream,
maxVersion: Version,
getClientTextureId: BrushFamilyDecodeCallback
): BrushFamily
Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, throwing an exception if parsing or validation was not successful. Java callers should use AndroidBrushFamilySerialization.decode instead.
| Parameters | |
|---|---|
input: InputStream |
|
maxVersion: Version |
The maximum |
getClientTextureId: BrushFamilyDecodeCallback |
A callback to store the decoded texture image, if one were encoded inside the serialized |
| Returns | |
|---|---|
BrushFamily |
The |
| Throws | |
|---|---|
java.io.IOException |
if gzip-format bytes cannot be read from |
IllegalArgumentException |
|
BrushFamily.Companion.decode
fun BrushFamily.Companion.decode(
input: InputStream,
maxVersion: Version = Version.MAX_SUPPORTED,
onDecodeTexture: OnDecodeTexturePngBytes? = null
): BrushFamily
Read a serialized BrushFamily from the given InputStream and parse it into a BrushFamily, throwing an exception if parsing or validation was not successful. Java callers should use BrushFamilySerialization.decode instead.
| Parameters | |
|---|---|
input: InputStream |
|
maxVersion: Version = Version.MAX_SUPPORTED |
The maximum |
onDecodeTexture: OnDecodeTexturePngBytes? = null |
A callback to store any decoded texture image, if any were encoded inside the serialized |
| Returns | |
|---|---|
BrushFamily |
The |
| Throws | |
|---|---|
java.io.IOException |
if gzip-format bytes cannot be read from |
IllegalArgumentException |
|
StrokeInputBatch.encode
fun StrokeInputBatch.encode(): ByteArray
Write a gzip-compressed ink.proto.CodedStrokeInputBatch binary proto message representing the StrokeInputBatch to the given ByteArray.
StrokeInputBatch.encode
fun StrokeInputBatch.encode(output: OutputStream): Unit
Write a gzip-compressed ink.proto.CodedStrokeInputBatch binary proto message representing the StrokeInputBatch to the given OutputStream.
BrushFamily.encode
fun BrushFamily.encode(textureIdToPngBytes: TexturePngBytesLookup? = null): ByteArray
Write a gzip-compressed ink.proto.BrushFamily binary proto message representing the BrushFamily to the given ByteArray using the provided texture map represented in corresponding arrays of keys (client texture IDs) and values (PNG bytes). If BrushFamily.hasFallbacks is true, then the stored proto message including fallbacks for this BrushFamily will be used instead of recomputing the proto from the BrushFamily object.
| Parameters | |
|---|---|
textureIdToPngBytes: TexturePngBytesLookup? = null |
A callback to retrieve the PNG bytes of the texture bitmap for a given client texture ID. |
BrushFamily.encode
fun BrushFamily.encode(
output: OutputStream,
textureBitmapStore: TextureBitmapStore
): Unit
Write a gzip-compressed ink.proto.BrushFamily binary proto message representing the BrushFamily to the given OutputStream. If hasFallbacks is true, then the stored, proto message including fallbacks for this BrushFamily will be used instead of recomputing the proto from the BrushFamily object.
| Parameters | |
|---|---|
BrushFamily |
The |
output: OutputStream |
The |
textureBitmapStore: TextureBitmapStore |
The |
BrushFamily.encode
fun BrushFamily.encode(
output: OutputStream,
textureIdToPngBytes: TexturePngBytesLookup? = null
): Unit
Write a gzip-compressed serialized ink.proto.BrushFamily proto message representing the BrushFamily to the given OutputStream. If BrushFamily.hasFallbacks is true, then the stored proto message including fallbacks for this BrushFamily will be used instead of recomputing the proto from the BrushFamily object.