Skip to content

Commit d79162e

Browse files
committed
Make internal buffer private
1 parent 33d3081 commit d79162e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkgs/gcloud/lib/src/storage_impl.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class _MediaUploadStreamSink implements StreamSink<List<int>> {
518518
final storage_api.Object _object;
519519
final String? _predefinedAcl;
520520
final int? _length;
521-
final BytesBuilder buffer = BytesBuilder();
521+
final BytesBuilder _buffer = BytesBuilder();
522522
final _controller = StreamController<List<int>>(sync: true);
523523
late StreamSubscription _subscription;
524524
late StreamController<List<int>> _resumableController;
@@ -576,12 +576,12 @@ class _MediaUploadStreamSink implements StreamSink<List<int>> {
576576
void _onData(List<int> data) {
577577
assert(_state != _stateLengthKnown);
578578
if (_state == _stateProbingLength) {
579-
buffer.add(data);
580-
if (buffer.length > _maxNormalUploadLength) {
579+
_buffer.add(data);
580+
if (_buffer.length > _maxNormalUploadLength) {
581581
// Start resumable upload.
582582
// TODO: Avoid using another stream-controller.
583583
_resumableController = StreamController<List<int>>(sync: true);
584-
_resumableController.add(buffer.takeBytes());
584+
_resumableController.add(_buffer.takeBytes());
585585
_startResumableUpload(_resumableController.stream, _length);
586586
_state = _stateDecidedResumable;
587587

@@ -604,7 +604,7 @@ class _MediaUploadStreamSink implements StreamSink<List<int>> {
604604
if (_state == _stateProbingLength) {
605605
// As the data is already cached don't bother to wait on somebody
606606
// listening on the stream before adding the data.
607-
_startNormalUpload(Stream.value(buffer.takeBytes()), buffer.length);
607+
_startNormalUpload(Stream.value(_buffer.takeBytes()), _buffer.length);
608608
} else {
609609
_resumableController.close();
610610
}

0 commit comments

Comments
 (0)