close method Null safety

Future<void> close()

Implementation

Future<void> close() async {
  var futures = <Future<void>>[];
  if (_content is InputStreamBase) {
    futures.add((_content as InputStreamBase).close());
  }
  if (_rawContent is InputStreamBase) {
    futures.add((_rawContent as InputStreamBase).close());
  }
  _content = null;
  _rawContent = null;
  await Future.wait(futures);
}