in lib/src/storage_impl.dart [579:596]
void _onData(List<int> data) {
assert(_state != _stateLengthKnown);
if (_state == _stateProbingLength) {
buffer.add(data);
_bufferLength += data.length;
if (_bufferLength > _maxNormalUploadLength) {
// Start resumable upload.
// TODO: Avoid using another stream-controller.
_resumableController = StreamController<List<int>>(sync: true);
buffer.forEach(_resumableController.add);
_startResumableUpload(_resumableController.stream, _length);
_state = _stateDecidedResumable;
}
} else {
assert(_state == _stateDecidedResumable);
_resumableController.add(data);
}
}