Hi,
I am using a B4XSerializator object to convert a payload I get from a MQTT message.
In the mqttclient_messageArrived event handler I get an error I can't fix.
Basically the below line crashes
serializator is defined in the Process_Global as
while Payload is a parameter of the handler
The crash message is:
java.util.zip.ZipException: incorrect header check
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:122)
at java.io.DataInputStream.readByte(DataInputStream.java:265)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readByte(B4XSerializator.java:131).....
.........
It really seems a trivial mistake but I can't understand what's wrong. Can anyone help?
thanks!!
pierluigi
I am using a B4XSerializator object to convert a payload I get from a MQTT message.
In the mqttclient_messageArrived event handler I get an error I can't fix.
Basically the below line crashes
B4X:
Dim obj As Object = serializator.ConvertBytesToObject(Payload) ' this one crashes
Dim s As String = obj
select s
case "start"
timer1.Enabled = True
case "stop"
timer1.enabled = False
.........
serializator is defined in the Process_Global as
B4X:
Dim serializator As B4XSerializator
while Payload is a parameter of the handler
B4X:
Sub mqttclient_MessageArrived (Topic As String, Payload() As Byte)
The crash message is:
java.util.zip.ZipException: incorrect header check
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:122)
at java.io.DataInputStream.readByte(DataInputStream.java:265)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readByte(B4XSerializator.java:131).....
.........
It really seems a trivial mistake but I can't understand what's wrong. Can anyone help?
thanks!!
pierluigi