Package pt.unl.fct.di.novasys.network
Interface ISerializer<T>
- Type Parameters:
T
- The type of the object which this class serializes
- All Known Implementing Classes:
AccrualMessageSerializer
,AckosMessageSerializer
,BabelMessageSerializer
public interface ISerializer<T>
Represents a serializer/deserializer that writes/reads objects to/from a byte buffer
- Author:
- pfouto
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(io.netty.buffer.ByteBuf in) Deserializes an object from a byte buffer and returns it.void
Serializes the received object into the received byte buffer.
-
Method Details
-
serialize
Serializes the received object into the received byte buffer.- Parameters:
t
- The object to serializeout
- The byte buffer to which the object will the written- Throws:
IOException
- if the serialization fails
-
deserialize
Deserializes an object from a byte buffer and returns it.- Parameters:
in
- The byte buffer which contains the object to be deserialized- Returns:
- The deserialized object
- Throws:
IOException
- if the deserialization fails
-