Make base64 decoding return a Uint8List.
This is more compact and more efficient if it ends up being sent between
isolates.
R=whesse@google.com
Review URL: https://codereview.chromium.org//1335713003 .
diff --git a/.gitignore b/.gitignore
index 89f7747..25a1df3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,5 @@
.settings/
build/
packages
+.packages
pubspec.lock
diff --git a/lib/src/base64.dart b/lib/src/base64.dart
index b4c03a8..d2f89b5 100644
--- a/lib/src/base64.dart
+++ b/lib/src/base64.dart
@@ -278,7 +278,7 @@
List<int> convert(String input) {
int length = input.length;
if (length == 0) {
- return new List<int>(0);
+ return new Uint8List<int>(0);
}
int normalLength = 0;
@@ -329,7 +329,7 @@
i--;
}
int outputLength = ((normalLength * 6) >> 3) - padLength;
- List<int> out = new List<int>(outputLength);
+ List<int> out = new Uint8List<int>(outputLength);
for (int i = 0, o = 0; o < outputLength; ) {
// Accumulate 4 valid 6 bit Base 64 characters into an int.