AndroidBrushFamilyExtensions
public final class AndroidBrushFamilyExtensions
Summary
Public methods |
|
|---|---|
static final @NonNull BrushFamily |
decode(See |
static final @NonNull BrushFamily |
decode(Read a serialized |
static final void |
encode(Write a gzip-compressed |
Public methods
decode
public static final @NonNull BrushFamily decode(
@NonNull BrushFamily.Companion receiver,
@NonNull InputStream input,
@NonNull BrushFamilyDecodeCallback getClientTextureId
)
See decode above. This overload uses Version.MAX_SUPPORTED.
decode
public static final @NonNull BrushFamily decode(
@NonNull BrushFamily.Companion receiver,
@NonNull InputStream input,
@NonNull Version maxVersion,
@NonNull BrushFamilyDecodeCallback getClientTextureId
)
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 | |
|---|---|
@NonNull InputStream input |
|
@NonNull Version maxVersion |
The maximum |
@NonNull BrushFamilyDecodeCallback getClientTextureId |
A callback to store the decoded texture image, if one were encoded inside the serialized |
| Returns | |
|---|---|
@NonNull BrushFamily |
The |
| Throws | |
|---|---|
java.io.IOException |
if gzip-format bytes cannot be read from |
IllegalArgumentException |
|
encode
public static final void encode(
@NonNull BrushFamily receiver,
@NonNull OutputStream output,
@NonNull TextureBitmapStore textureBitmapStore
)
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 | |
|---|---|
@NonNull BrushFamily receiver |
The |
@NonNull OutputStream output |
The |
@NonNull TextureBitmapStore textureBitmapStore |
The |