@Nullable ByteBuffer encodeMessage(@Nullable T message)
message- the T message, possibly null.
@Nullable T decodeMessage(@Nullable ByteBuffer message)
Warning: The ByteBuffer is "direct" and it won't be valid beyond this call. Storing
the ByteBuffer and using it later and will lead to a
If you want to retain the data you'll need to copy it.
ByteBuffermessage, possibly null.