'Serialize/De-Serialize Optional values using IoBuffer

In our project we are using the org.apache.mina.core.buffer.IoBuffer to serialize and deserialize objects and send it through the network. There is one more requirement to send Optional values over the same. Optional<> being a non serializable entity I am not able to do so. Is there a workaround to fix this issue?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source