Package io.hekate.codec
Interface DecodeFunction<T>
-
- Type Parameters:
T
- Type of the result of the function.
- All Known Subinterfaces:
Codec<T>
- All Known Implementing Classes:
GossipProtocolCodec
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface DecodeFunction<T>
Functional interface for decoding data from binary format.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description T
decode(DataReader in)
Decodes object from the provided reader.default T
decodeUnchecked(DataReader in)
Same asdecode(DataReader)
but throws an unchecked exception.
-
-
-
Method Detail
-
decode
T decode(DataReader in) throws IOException
Decodes object from the provided reader.- Parameters:
in
- Data reader.- Returns:
- Decoded object.
- Throws:
IOException
- If object couldn't be decoded.
-
decodeUnchecked
default T decodeUnchecked(DataReader in) throws CodecException
Same asdecode(DataReader)
but throws an unchecked exception.- Parameters:
in
- Data reader.- Returns:
- Decoded object.
- Throws:
CodecException
- If object couldn't be decoded.
-
-