decodeStream 方法

Future<String> decodeStream(
  1. Stream<List<int>> byteStream
)

实现

Future<String> decodeStream(Stream<List<int>> byteStream) {
  return decoder
      .bind(byteStream)
      .fold(StringBuffer(),
          (StringBuffer buffer, String string) => buffer..write(string))
      .then((StringBuffer buffer) => buffer.toString());
}