Whenever i try to write bytes to the outpustream with this code:
B4X:
Dim r As Reflector
r.Target = Response
Dim jo As JavaObject = r.GetField("res")
Dim ser As B4XSerializator
Dim out As OutputStream = jo.RunMethod("getOutputStream", Null)
Dim data() As Byte = ser.ConvertObjectToBytes( Object )
out.WriteBytes( data, 0, data.Length )
i get java.io.EOFException: Unexpected end of ZLIB input stream at client side.
B4X:
Sub JobDone ( j as httjob )
if j.success then
dim data() as byte = bit.inpustreamtobytes( j.getinpustream) '< '-- Error
end if
End Sub
You could cheat. You could Base64 encode the data() array and sent it with SendString. On the client side the GetString method would contain the Base64 encoded string.
You could cheat. You could Base64 encode the data() array and sent it with SendString. On the client side the GetString method would contain the Base64 encoded string.
Well i'm afraid this is not an option for me. The base64 overhead is just too much.
I'll look into another method to work with the bytes directly , given that there's not solution to my original problem.