Index: runtime/lib/byte_array.dart |
=================================================================== |
--- runtime/lib/byte_array.dart (revision 3627) |
+++ runtime/lib/byte_array.dart (working copy) |
@@ -63,6 +63,31 @@ |
return _length(); |
} |
cshapiro
2012/01/28 02:25:48
This code should be moved downward beneath the Lis
Anders Johnsen
2012/01/30 21:15:28
Done.
|
+ void setRange(int start, int length, List<int> from, [int startFrom = 0]) { |
+ if (length < 0) { |
+ throw new IllegalArgumentException("negative length $length"); |
+ } |
+ if (from is ByteArray) { |
+ _setRange(from, startFrom, start, length); |
+ } else { |
+ Arrays.copy(from, startFrom, this, start, length); |
+ } |
+ } |
+ |
+ List getRange(int start, int length) { |
+ if (length == 0) return []; |
+ Arrays.rangeCheck(this, start, length); |
+ ByteArray list = new ByteArray(length); |
+ list._setRange(this, start, 0, length); |
+ return list; |
+ } |
+ |
+ void _setRange(ByteArray src, |
cshapiro
2012/01/28 02:25:48
This should be moved to the very bottom with the o
Anders Johnsen
2012/01/30 21:15:28
Done.
|
+ int srcStart, |
+ int dstStart, |
+ int count) |
+ native "ByteArray_setRange"; |
+ |
bool every(bool f(int element)) { |
return Collections.every(this, f); |
} |