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 patch class Int8List { | 5 patch class Int8List { |
6 /* patch */ factory Int8List(int length) { | 6 /* patch */ factory Int8List(int length) { |
7 return new _Int8Array(length); | 7 return new _Int8Array(length); |
8 } | 8 } |
9 | 9 |
10 /* patch */ factory Int8List.transferable(int length) { | 10 /* patch */ factory Int8List.transferable(int length) { |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 ByteArray asByteArray([int start = 0, int length]) { | 400 ByteArray asByteArray([int start = 0, int length]) { |
401 if (length == null) { | 401 if (length == null) { |
402 length = this.length; | 402 length = this.length; |
403 } | 403 } |
404 _rangeCheck(this.length, start, length); | 404 _rangeCheck(this.length, start, length); |
405 return new _ByteArrayView(this, | 405 return new _ByteArrayView(this, |
406 start * this.bytesPerElement(), | 406 start * this.bytesPerElement(), |
407 length * this.bytesPerElement()); | 407 length * this.bytesPerElement()); |
408 } | 408 } |
409 | 409 |
410 List<int> toList({ bool growable: false }) { | 410 List<int> toList({ bool growable: true }) { |
411 return new List<int>.from(this, growable: growable); | 411 return new List<int>.from(this, growable: growable); |
412 } | 412 } |
413 | 413 |
414 Set<int> toSet() { | 414 Set<int> toSet() { |
415 return new Set<int>.from(this); | 415 return new Set<int>.from(this); |
416 } | 416 } |
417 | 417 |
418 int _length() native "ByteArray_getLength"; | 418 int _length() native "ByteArray_getLength"; |
419 | 419 |
420 void _setRange(int startInBytes, int lengthInBytes, | 420 void _setRange(int startInBytes, int lengthInBytes, |
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2703 ByteArray asByteArray([int start = 0, int length]) { | 2703 ByteArray asByteArray([int start = 0, int length]) { |
2704 if (length == null) { | 2704 if (length == null) { |
2705 length = this.lengthInBytes(); | 2705 length = this.lengthInBytes(); |
2706 } | 2706 } |
2707 _rangeCheck(this.length, start, length); | 2707 _rangeCheck(this.length, start, length); |
2708 return _array.subByteArray(_offset + start, length); | 2708 return _array.subByteArray(_offset + start, length); |
2709 } | 2709 } |
2710 | 2710 |
2711 static const int _BYTES_PER_ELEMENT = 8; | 2711 static const int _BYTES_PER_ELEMENT = 8; |
2712 } | 2712 } |
OLD | NEW |