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

Unified Diff: sdk/lib/convert/base64.dart

Issue 1432203002: Revert "Add data-URI support class to dart:core (next to Uri)." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « runtime/bin/builtin.dart ('k') | sdk/lib/core/core.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/convert/base64.dart
diff --git a/sdk/lib/convert/base64.dart b/sdk/lib/convert/base64.dart
index 66c1f0ce951e281e9e022ed2d61b6cbdac2a2e48..77f7158008902eced9c39244400b72a4209e6166 100644
--- a/sdk/lib/convert/base64.dart
+++ b/sdk/lib/convert/base64.dart
@@ -307,12 +307,12 @@ class _Utf8Base64EncoderSink extends _Base64EncoderSink {
class Base64Decoder extends Converter<String, List<int>> {
const Base64Decoder();
- List<int> convert(String input, [int start = 0, int end]) {
- end = RangeError.checkValidRange(start, end, input.length);
- if (start == end) return new Uint8List(0);
+ List<int> convert(String input) {
+ if (input.isEmpty) return new Uint8List(0);
+ int length = input.length;
var decoder = new _Base64Decoder();
- Uint8List buffer = decoder.decode(input, start, end);
- decoder.close(input, end);
+ Uint8List buffer = decoder.decode(input, 0, input.length);
+ decoder.close(input, input.length);
return buffer;
}
« no previous file with comments | « runtime/bin/builtin.dart ('k') | sdk/lib/core/core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698