Interface MessageEncoder<T>
- Type Parameters:
T- the type of values to encode
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Encodes values of type
T and writes them to a MessageSink.-
Method Summary
Modifier and TypeMethodDescriptionvoidencode(T value, MessageSink sink) Encodes a value and writes it to a message sink.static MessageEncoder<CharSequence> ofString()Returns a new message encoder that encodes strings.
-
Method Details
-
ofString
Returns a new message encoder that encodes strings.- Returns:
- a new message encoder that encodes strings
-
encode
Encodes a value and writes it to a message sink.- Parameters:
value- the value to encodesink- the message sink to write to- Throws:
IOException- if an I/O error occurs
-