Index: lib/protobuf/runtime/ByteArrayProvider.dart |
diff --git a/lib/protobuf/runtime/ByteArrayProvider.dart b/lib/protobuf/runtime/ByteArrayProvider.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6afbba03aa71ce88e40465532ab8690eee821f8c |
--- /dev/null |
+++ b/lib/protobuf/runtime/ByteArrayProvider.dart |
@@ -0,0 +1,13 @@ |
+// Copyright (c) 2012, 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. |
+ |
+/** |
+ * Provides a ByteArray based version of integer arrays. |
+ */ |
+List<int> createIntArray(int length) => new Uint8List(length); |
+List<int> createIntArrayFrom(List<int> source) { |
+ Uint8List array = new Uint8List(source.length); |
+ array.setRange(0, source.length, source, 0); |
+ return array; |
+} |