public final class StringCodec extends Object implements MessageCodec<String>
MessageCodec using UTF-8 encoded String messages.
This codec is guaranteed to be compatible with the corresponding StringCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.
| Modifier and Type | Field and Description |
|---|---|
static StringCodec |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
String |
decodeMessage(ByteBuffer message)
Decodes the specified message from binary.
|
ByteBuffer |
encodeMessage(String message)
Encodes the specified message into binary.
|
public static final StringCodec INSTANCE
public ByteBuffer encodeMessage(String message)
MessageCodecencodeMessage in interface MessageCodec<String>message - the T message, possibly null.public String decodeMessage(ByteBuffer message)
MessageCodecdecodeMessage in interface MessageCodec<String>message - the ByteBuffer message, possibly null.