Interface MessageDecoder<T>
- Type Parameters:
T- the type of values decoded by this message decoder
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Reads values from a
MessageSource and decodes them into values of type T.-
Method Summary
Modifier and TypeMethodDescriptiondecode(MessageSource source) Reads the next value from a message source and decodes it into a value of typeT.static MessageDecoder<String> ofString()Returns a new message decoder that decodes strings.
-
Method Details
-
ofString
Returns a new message decoder that decodes strings.- Returns:
- a new message decoder that decodes strings
-
decode
Reads the next value from a message source and decodes it into a value of typeT.- Parameters:
source- the message source to read from- Returns:
- the decoded value
- Throws:
IOException- if an I/O error occurs
-