decode function
Implementation
dynamic decode(Uint8List input, [bool stream = false]) {
if (input.isEmpty) {
return <dynamic>[];
}
Uint8List inputBuffer = _toBuffer(input);
Decoded decoded = _decode(inputBuffer);
if (stream) {
return decoded;
}
if (decoded.remainder.length != 0) {
throw FormatException('invalid remainder');
}
return decoded.data;
}