@@ -108,9 +108,9 @@ class _MessageType {
108108 * _HttpDetachedStreamSubscription is resumed, it'll deliver the data before
109109 * resuming the underlaying subscription.
110110 */
111- class _HttpDetachedStreamSubscription implements StreamSubscription <List < int > > {
112- StreamSubscription <List < int > > _subscription;
113- List < int > _injectData;
111+ class _HttpDetachedStreamSubscription implements StreamSubscription <Uint8List > {
112+ StreamSubscription <Uint8List > _subscription;
113+ Uint8List _injectData;
114114 bool _isCanceled = false ;
115115 int _pauseCount = 1 ;
116116 Function _userOnData;
@@ -130,7 +130,7 @@ class _HttpDetachedStreamSubscription implements StreamSubscription<List<int>> {
130130 return _subscription.cancel ();
131131 }
132132
133- void onData (void handleData (List < int > data)) {
133+ void onData (void handleData (Uint8List data)) {
134134 _userOnData = handleData;
135135 _subscription.onData (handleData);
136136 }
@@ -182,13 +182,13 @@ class _HttpDetachedStreamSubscription implements StreamSubscription<List<int>> {
182182 }
183183}
184184
185- class _HttpDetachedIncoming extends Stream <List < int > > {
186- final StreamSubscription <List < int > > subscription;
187- final List < int > bufferedData;
185+ class _HttpDetachedIncoming extends Stream <Uint8List > {
186+ final StreamSubscription <Uint8List > subscription;
187+ final Uint8List bufferedData;
188188
189189 _HttpDetachedIncoming (this .subscription, this .bufferedData);
190190
191- StreamSubscription <List < int >> listen (void onData (List < int > event),
191+ StreamSubscription <Uint8List > listen (void onData (Uint8List event),
192192 {Function onError, void onDone (), bool cancelOnError}) {
193193 if (subscription != null ) {
194194 subscription
@@ -203,7 +203,7 @@ class _HttpDetachedIncoming extends Stream<List<int>> {
203203 ..resume ();
204204 } else {
205205 // TODO(26379): add test for this branch.
206- return new Stream <List < int > >.fromIterable ([bufferedData]).listen (onData,
206+ return new Stream <Uint8List >.fromIterable ([bufferedData]).listen (onData,
207207 onError: onError, onDone: onDone, cancelOnError: cancelOnError);
208208 }
209209 }
@@ -261,7 +261,7 @@ class _HttpParser extends Stream<_HttpIncoming> {
261261
262262 // The current incoming connection.
263263 _HttpIncoming _incoming;
264- StreamSubscription <List < int > > _socketSubscription;
264+ StreamSubscription <Uint8List > _socketSubscription;
265265 bool _paused = true ;
266266 bool _bodyPaused = false ;
267267 StreamController <_HttpIncoming > _controller;
@@ -303,7 +303,7 @@ class _HttpParser extends Stream<_HttpIncoming> {
303303 onError: onError, onDone: onDone, cancelOnError: cancelOnError);
304304 }
305305
306- void listenToStream (Stream <List < int > > stream) {
306+ void listenToStream (Stream <Uint8List > stream) {
307307 // Listen to the stream and handle data accordingly. When a
308308 // _HttpIncoming is created, _dataPause, _dataResume, _dataDone is
309309 // given to provide a way of controlling the parser.
@@ -802,7 +802,7 @@ class _HttpParser extends Stream<_HttpIncoming> {
802802 }
803803 }
804804
805- void _onData (List < int > buffer) {
805+ void _onData (Uint8List buffer) {
806806 _socketSubscription.pause ();
807807 assert (_buffer == null );
808808 _buffer = buffer;
@@ -888,7 +888,7 @@ class _HttpParser extends Stream<_HttpIncoming> {
888888 return new _HttpDetachedIncoming (_socketSubscription, readUnparsedData ());
889889 }
890890
891- List < int > readUnparsedData () {
891+ Uint8List readUnparsedData () {
892892 if (_buffer == null ) return null ;
893893 if (_index == _buffer.length) return null ;
894894 var result = _buffer.sublist (_index);
0 commit comments