API signature of the obWebSocketBinary
method of WebSocketListener
and it's subclasses looks like this:
void onWebSocketBinary(byte[] payload, int offset, int len)
Let's call the bytes in the payload
from offset
due len
- 'current_bytes'. How should I interpret this API:
- the 'current_bytes' are the whole binary message sent from the client, rest of the
payload
array is not related to this session call - the 'current_bytes' are partial binary message and I should collect the data till
offset
+len
will be equal topayload.length
- the 'current_bytes' are partial binary message, but I should manage the notion of the 'full message delivered' myself by the means of inspecting the payload content
If, presumably, the offset
due len
is not the full content of the payload
array, can I consider it as a 'shared' memory used as a buffer for different payloads?