PluginAwareMessageCodec class

A message codec that can be used to encode and decode messages for a list of MessageCodecs.

The codec will try to decode the message with each MessageCodec until one of them succeeds. If no MessageCodec can decode the message, the codec will return null.

This codec is designed to support the plugin system. It is used to encode and decode messages with the default codec and the plugins' codecs.

Implemented types

Constructors

PluginAwareMessageCodec.new(List<MessageCodec<Message>> _codecs)
Constructor
const
PluginAwareMessageCodec.fromPlugins({required MessageCodec<Message> defaultCodec, required List<SyncPlugin> plugins})
Constructor from a default codec and a list of plugins

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode(List<int> data) Message?
Decode a message from the transport format
override
encode(Message message) List<int>?
Encode a message into a format suitable for transport
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited