5
5
import 'dart:async' ;
6
6
import 'dart:collection' ;
7
7
import 'dart:io' ;
8
+ import 'dart:typed_data' ;
8
9
9
10
import 'package:bazel_worker/bazel_worker.dart' ;
10
11
@@ -50,12 +51,12 @@ class TestStdinSync implements TestStdin {
50
51
/// Note: You must call [close] in order for the loop to exit properly.
51
52
class TestStdinAsync implements TestStdin {
52
53
/// Controls the stream for async delivery of bytes.
53
- final StreamController <List < int > > _controller = new StreamController ();
54
- StreamController <List < int > > get controller => _controller;
54
+ final StreamController <Uint8List > _controller = new StreamController ();
55
+ StreamController <Uint8List > get controller => _controller;
55
56
56
57
/// Adds all the [bytes] to this stream.
57
58
void addInputBytes (List <int > bytes) {
58
- _controller.add (bytes);
59
+ _controller.add (Uint8List . fromList ( bytes) );
59
60
}
60
61
61
62
/// Closes this stream. This is necessary for the [AsyncWorkerLoop] to exit.
@@ -64,7 +65,7 @@ class TestStdinAsync implements TestStdin {
64
65
}
65
66
66
67
@override
67
- StreamSubscription <List < int >> listen (onData (List < int > bytes),
68
+ StreamSubscription <Uint8List > listen (onData (Uint8List bytes),
68
69
{Function onError, void onDone (), bool cancelOnError}) {
69
70
return _controller.stream.listen (onData,
70
71
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
0 commit comments