MyMessage originalMessage = new MyMessage("Munish", 36, "Bangalore");
System.out.println("The original message is as " + originalMessage);
// Get the Binded Serializer for it
Serializer serializer = serialization
.findSerializerFor(originalMessage);
// Turn the object into bytes
byte[] bytes = serializer.toBinary(originalMessage);
// Turn the byte[] back into an object,
MyMessage deSerializedMessage = (MyMessage) serializer.fromBinary(
bytes, MyMessage.class);
System.out.println("The de-serialized message is as " + deSerializedMessage);
system.shutdown();