convertToString method

Future<String> convertToString()

Implementation

Future<String> convertToString() async {
  if (!closed) {
    // wait until data stream is closed
    while (await Future<bool>.delayed(
        const Duration(milliseconds: 100), () => !closed)) {}
  }
  String ret = String.fromCharCodes(_currentList);
  _currentList.clear();
  return ret;
}