decodePayload static method
dynamic
decodePayload(
- dynamic encodedPayload,
- dynamic binaryType
Decodes data when a payload is maybe expected. Possible binary contents are decoded from their base64 representation
Implementation
static decodePayload(encodedPayload, binaryType) {
var encodedPackets = encodedPayload.split(SEPARATOR);
var packets = [];
for (var i = 0; i < encodedPackets.length; i++) {
var decodedPacket = decoder.decodePacket(encodedPackets[i], binaryType);
packets.add(decodedPacket);
if (decodedPacket['type'] == "error") {
break;
}
}
return packets;
}