Flutter Engine
The Flutter Engine
|
Classes | |
class | ExposedByteArrayOutputStream |
Public Member Functions | |
ByteBuffer | encodeMessage (@Nullable Object message) |
Object | decodeMessage (@Nullable ByteBuffer message) |
Public Member Functions inherited from io.flutter.plugin.common.MessageCodec< Object > | |
ByteBuffer | encodeMessage ( @Nullable T message) |
T | decodeMessage ( @Nullable ByteBuffer message) |
Static Public Attributes | |
static final StandardMessageCodec | INSTANCE = new StandardMessageCodec() |
Protected Member Functions | |
void | writeValue (@NonNull ByteArrayOutputStream stream, @Nullable Object value) |
final Object | readValue (@NonNull ByteBuffer buffer) |
Object | readValueOfType (byte type, @NonNull ByteBuffer buffer) |
Static Protected Member Functions | |
static final void | writeSize (@NonNull ByteArrayOutputStream stream, int value) |
static final void | writeChar (@NonNull ByteArrayOutputStream stream, int value) |
static final void | writeInt (@NonNull ByteArrayOutputStream stream, int value) |
static final void | writeLong (@NonNull ByteArrayOutputStream stream, long value) |
static final void | writeFloat (@NonNull ByteArrayOutputStream stream, float value) |
static final void | writeDouble (@NonNull ByteArrayOutputStream stream, double value) |
static final void | writeBytes ( @NonNull ByteArrayOutputStream stream, @NonNull byte[] bytes) |
static final void | writeAlignment (@NonNull ByteArrayOutputStream stream, int alignment) |
static final int | readSize (@NonNull ByteBuffer buffer) |
static final byte[] | readBytes (@NonNull ByteBuffer buffer) |
static final void | readAlignment (@NonNull ByteBuffer buffer, int alignment) |
MessageCodec using the Flutter standard binary encoding.
This codec is guaranteed to be compatible with the corresponding StandardMessageCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Supported messages are acyclic values of these forms:
On the Dart side, these values are represented as follows:
BigIntegers are represented in Dart as strings with the hexadecimal representation of the integer's value.
To extend the codec, overwrite the writeValue and readValueOfType methods.
Definition at line 65 of file StandardMessageCodec.java.
|
inline |
Definition at line 84 of file StandardMessageCodec.java.
|
inline |
Definition at line 71 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Reads alignment padding bytes as written by writeAlignment.
Definition at line 326 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Reads a byte array as written by writeBytes.
Definition at line 318 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Reads an int representing a size as written by writeSize.
Definition at line 302 of file StandardMessageCodec.java.
|
inlineprotected |
Reads a value as written by writeValue.
Definition at line 335 of file StandardMessageCodec.java.
|
inlineprotected |
Reads a value of the specified type.
Subclasses may extend the codec by overriding this method, calling super for types that the extension does not handle.
Definition at line 350 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Writes a number of padding bytes to the specified stream to ensure that the next value is aligned to a whole multiple of the specified alignment. An example usage with alignment = 8 is to ensure doubles are word-aligned in the stream.
Definition at line 204 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Writes the length and then the actual bytes of the specified array to the specified stream.
Definition at line 193 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Writes the least significant two bytes of the specified int to the specified stream.
Definition at line 134 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Writes the specified double as 8 bytes to the specified stream.
Definition at line 188 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Writes the specified double as 4 bytes to the specified stream
Definition at line 183 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Writes the specified int as 4 bytes to the specified stream.
Definition at line 145 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Writes the specified long as 8 bytes to the specified stream.
Definition at line 160 of file StandardMessageCodec.java.
|
inlinestaticprotected |
Writes an int representing a size to the specified stream. Uses an expanding code of 1 to 5 bytes to optimize for small values.
Definition at line 118 of file StandardMessageCodec.java.
|
inlineprotected |
Writes a type discriminator byte and then a byte serialization of the specified value to the specified stream.
Subclasses can extend the codec by overriding this method, calling super for values that the extension does not handle.
Definition at line 220 of file StandardMessageCodec.java.
|
static |
Definition at line 67 of file StandardMessageCodec.java.