and then get a json by toJson method, and then call MqttWill(JsonObject json) constructor will get a MqttWill instance which the message field is different!!!
I have found the reason. It is because of when call toJson method, willMessage byte[] will be cast to string by Base64, and then when call MqttWill(JsonObject json) constructor, willMessage byte[] cast by getBytes(Charset.forName("UTF-8")).
In addition, because of #135 , even I can not test this problem, but I have writed a same class which has solved #135 problem and tested this problem.
MqttWill class has a from json constructor:
and a to json method:
But these two are not reversible, which means, if I create a MqttWill instance by:
and then get a json by toJson method, and then call MqttWill(JsonObject json) constructor will get a MqttWill instance which the message field is different!!! I have found the reason. It is because of when call toJson method, willMessage byte[] will be cast to string by Base64, and then when call MqttWill(JsonObject json) constructor, willMessage byte[] cast by getBytes(Charset.forName("UTF-8")).
In addition, because of #135 , even I can not test this problem, but I have writed a same class which has solved #135 problem and tested this problem.
Please check.