| OLD | NEW |
| 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 Loading... |
| 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 // Implementation | 148 // Implementation |
| 145 | 149 |
| 146 int _length() native "ByteArray_getLength"; | 150 int _length() native "ByteArray_getLength"; |
| 147 } | 151 } |
| 148 | 152 |
| 149 | 153 |
| 150 class _ByteArrayIterator implements Iterator { | 154 class _ByteArrayIterator implements Iterator { |
| 151 _ByteArrayIterator(List byteArray) | 155 _ByteArrayIterator(List byteArray) |
| 152 : _byteArray = byteArray, _length = byteArray.length, _pos = 0 { | 156 : _byteArray = byteArray, _length = byteArray.length, _pos = 0 { |
| 153 assert(byteArray is ByteArray); | 157 assert(byteArray is ByteArray); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 484 |
| 481 void _setFloat32(int byteOffset, double value) | 485 void _setFloat32(int byteOffset, double value) |
| 482 native "ExternalByteArray_setFloat32"; | 486 native "ExternalByteArray_setFloat32"; |
| 483 | 487 |
| 484 double _getFloat64(int byteOffset) | 488 double _getFloat64(int byteOffset) |
| 485 native "ExternalByteArray_getFloat64"; | 489 native "ExternalByteArray_getFloat64"; |
| 486 | 490 |
| 487 void _setFloat64(int byteOffset, double value) | 491 void _setFloat64(int byteOffset, double value) |
| 488 native "ExternalByteArray_setFloat64"; | 492 native "ExternalByteArray_setFloat64"; |
| 489 } | 493 } |
| OLD | NEW |