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

Side by Side Diff: runtime/lib/byte_array.dart

Issue 9416053: Revert "Wrote functions to convert collections and maps to strings and invoked" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/arrays.dart ('k') | runtime/lib/collections.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 interface ByteArray extends List default _InternalByteArray { 5 interface ByteArray extends List default _InternalByteArray {
6 ByteArray(int length); 6 ByteArray(int length);
7 7
8 int get length(); 8 int get length();
9 9
10 int getInt8(int byteOffset); 10 int getInt8(int byteOffset);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 int removeLast() { 135 int removeLast() {
136 throw const UnsupportedOperationException( 136 throw const UnsupportedOperationException(
137 "Cannot remove from a byte array"); 137 "Cannot remove from a byte array");
138 } 138 }
139 139
140 int last() { 140 int last() {
141 return this[length - 1]; 141 return this[length - 1];
142 } 142 }
143 143
144 String toString() {
145 return Collections.collectionToString(this);
146 }
147
148 void setRange(int start, int length, List<int> from, [int startFrom = 0]) { 144 void setRange(int start, int length, List<int> from, [int startFrom = 0]) {
149 if (length < 0) { 145 if (length < 0) {
150 throw new IllegalArgumentException("negative length $length"); 146 throw new IllegalArgumentException("negative length $length");
151 } 147 }
152 if (from is ByteArray) { 148 if (from is ByteArray) {
153 _setRange(start, length, from, startFrom); 149 _setRange(start, length, from, startFrom);
154 } else { 150 } else {
155 Arrays.copy(from, startFrom, this, start, length); 151 Arrays.copy(from, startFrom, this, start, length);
156 } 152 }
157 } 153 }
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 504
509 void _setFloat32(int byteOffset, double value) 505 void _setFloat32(int byteOffset, double value)
510 native "ExternalByteArray_setFloat32"; 506 native "ExternalByteArray_setFloat32";
511 507
512 double _getFloat64(int byteOffset) 508 double _getFloat64(int byteOffset)
513 native "ExternalByteArray_getFloat64"; 509 native "ExternalByteArray_getFloat64";
514 510
515 void _setFloat64(int byteOffset, double value) 511 void _setFloat64(int byteOffset, double value)
516 native "ExternalByteArray_setFloat64"; 512 native "ExternalByteArray_setFloat64";
517 } 513 }
OLDNEW
« no previous file with comments | « runtime/lib/arrays.dart ('k') | runtime/lib/collections.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698