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

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

Issue 9431015: Wrote functions to convert collections and maps to strings and invoked (Closed) Base URL: http://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
144 void setRange(int start, int length, List<int> from, [int startFrom = 0]) { 148 void setRange(int start, int length, List<int> from, [int startFrom = 0]) {
145 if (length < 0) { 149 if (length < 0) {
146 throw new IllegalArgumentException("negative length $length"); 150 throw new IllegalArgumentException("negative length $length");
147 } 151 }
148 if (from is ByteArray) { 152 if (from is ByteArray) {
149 _setRange(start, length, from, startFrom); 153 _setRange(start, length, from, startFrom);
150 } else { 154 } else {
151 Arrays.copy(from, startFrom, this, start, length); 155 Arrays.copy(from, startFrom, this, start, length);
152 } 156 }
153 } 157 }
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 508
505 void _setFloat32(int byteOffset, double value) 509 void _setFloat32(int byteOffset, double value)
506 native "ExternalByteArray_setFloat32"; 510 native "ExternalByteArray_setFloat32";
507 511
508 double _getFloat64(int byteOffset) 512 double _getFloat64(int byteOffset)
509 native "ExternalByteArray_getFloat64"; 513 native "ExternalByteArray_getFloat64";
510 514
511 void _setFloat64(int byteOffset, double value) 515 void _setFloat64(int byteOffset, double value)
512 native "ExternalByteArray_setFloat64"; 516 native "ExternalByteArray_setFloat64";
513 } 517 }
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