readFromStreamCompressed static method

Future<Tag> readFromStreamCompressed(
  1. Uint8List list, [
  2. void onReadListener(
    1. int
    )?
])

Implementation

static Future<Tag> readFromStreamCompressed(Uint8List list,
    [void Function(int)? onReadListener]) async {
  _io.disposeStream();
  _io = ByteLayer();
  _io.addListener(onReadListener);
  try {
    _io.writeBytes(list);
    _io.resetPosition();
    _io.decompress();
    _io.resetPosition();
  } catch (E) {
    print(E);
  } finally {
    return Tag.readNamedTag(_io);
  }
}