A simple java class to serialize and deserialize object to a byte array