Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1041)

Unified Diff: lib/src/base64/encoder_sink.dart

Issue 1819293003: Remove deprecated APIs. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/base64/encoder.dart ('k') | lib/src/crypto_utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/base64/encoder_sink.dart
diff --git a/lib/src/base64/encoder_sink.dart b/lib/src/base64/encoder_sink.dart
deleted file mode 100644
index 293735bd283f8d4eb7db9c25935b0146de1f8e0e..0000000000000000000000000000000000000000
--- a/lib/src/base64/encoder_sink.dart
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:convert';
-
-import 'encoder.dart';
-
-/// This is deprecated.
-///
-/// Use the `Base64Encoder` class in `dart:convert` instead.
-@Deprecated("Will be removed in crypto 1.0.0.")
-class Base64EncoderSink extends ChunkedConversionSink<List<int>> {
- /// The encoder used to encode each chunk.
- final Base64Encoder _encoder;
-
- /// The underlying sink to which to emit the encoded strings.
- final ChunkedConversionSink<String> _outSink;
-
- /// The buffer of as-yet-unconverted bytes.
- ///
- /// This is used to ensure that we don't generate interstitial padding
- /// characters.
- final _buffer = new List<int>();
-
- /// The length of [_buffer]; that is, the number of unconverted bytes.
- var _bufferCount = 0;
-
- Base64EncoderSink(this._outSink, urlSafe, addLineSeparator)
- : _encoder = new Base64Encoder(
- urlSafe: urlSafe, addLineSeparator: addLineSeparator);
-
- void add(List<int> chunk) {
- var nextBufferCount = (chunk.length + _bufferCount) % 3;
- var decodableLength = _bufferCount + chunk.length - nextBufferCount;
-
- if (_bufferCount + chunk.length > _buffer.length) {
- _buffer.replaceRange(_bufferCount, _buffer.length,
- chunk.sublist(0, _buffer.length - _bufferCount));
- _buffer.addAll(chunk.sublist(_buffer.length - _bufferCount));
- } else {
- _buffer.replaceRange(_bufferCount, _bufferCount + chunk.length, chunk);
- }
-
- _outSink.add(_encoder.convert(_buffer, 0, decodableLength));
- _buffer.removeRange(0, decodableLength);
- _bufferCount = nextBufferCount;
- }
-
- void close() {
- if (_bufferCount > 0) {
- _outSink.add(_encoder.convert(_buffer.sublist(0, _bufferCount)));
- }
- _outSink.close();
- }
-}
-
« no previous file with comments | « lib/src/base64/encoder.dart ('k') | lib/src/crypto_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698