I currenty do using base64 encoded strings, but I wonder if there are limits and better options?
In detail:
- are there limits for BindWebViewCallback function parameter JsonParameters$ size?
- are there limits for WebViewExecuteScript function parameter JavaScript$ size?
I talk about sizes up to 250MB, which is the minimum I need to support. With base64 and string conversion, it needs 2.6 times the amount of memory:
Code: Select all
; memory consumption test
size.i = 1000
*mem = AllocateMemory(size.i)
; fill with random stuff
For x.i = 0 To size.i - 1
PokeB(*mem + x.i, Random(255, 0))
Next
b64.s = Base64Encoder(*mem, size.i)
b64size.i = StringByteLength(b64.s)
Debug "Original data size: " + Str(size.i) + " bytes"
Debug b64.s
Debug "Bytes to transfer to WebViewGadget: " + Str(b64size.i) + " bytes"
Debug "Overhead: " + StrF(b64size.i/size.i) + " times"
Or am I completely wrong?