io.flutter.plugin.common

## Interface MessageCodec<T>

- All Known Implementing Classes:
    BinaryCodec, JSONMessageCodec, StandardMessageCodec, StringCodec

      public interface MessageCodec<T>

  A message encoding/decoding mechanism.

  Both operations throw `IllegalArgumentException`, if conversion fails.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `decodeMessage(ByteBuffer message)` Decodes the specified message from binary.
    `ByteBuffer` | `encodeMessage(T message)` Encodes the specified message into binary.

- - ### Method Detail

    - #### encodeMessage

          @Nullable
          ByteBuffer encodeMessage(@Nullable
                                             T message)

      Encodes the specified message into binary.
      Parameters:
        `message` - the T message, possibly null.
      Returns:
        a ByteBuffer containing the encoding between position 0 and the current position, or null, if message is null.

    - #### decodeMessage

          @Nullable
          T decodeMessage(@Nullable
                                    ByteBuffer message)

      Decodes the specified message from binary.
      Parameters:
        `message` - the `ByteBuffer` message, possibly null.
      Returns:
        a T value representation of the bytes between the given buffer's current position and its limit, or null, if message is null.