decodeDataBlob function

Object decodeDataBlob(
  1. Uint8List bytes
)

Decode a Remote Flutter Widgets binary data blob.

This data is usually used in conjunction with DynamicContent.

This method supports a subset of the format supported by decodeLibraryBlob; specifically, it reads a value from that format (rather than a library), and disallows values other than maps, lists, ints, doubles, booleans, and strings. See decodeLibraryBlob for a description of the format.

The first four bytes of the file (in hex) are FE 52 57 44; see dataBlobSignature.

See also:

Implementation

Object decodeDataBlob(Uint8List bytes) {
  final _BlobDecoder decoder = _BlobDecoder(bytes.buffer.asByteData(bytes.offsetInBytes, bytes.lengthInBytes));
  decoder.expectSignature(dataBlobSignature);
  final Object result = decoder.readValue();
  if (!decoder.finished) {
    throw const FormatException('Unexpected trailing bytes after value.');
  }
  return result;
}