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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 ByteArray asByteArray([int start = 0, int length]) { | 401 ByteArray asByteArray([int start = 0, int length]) { |
402 if (length == null) { | 402 if (length == null) { |
403 length = this.length; | 403 length = this.length; |
404 } | 404 } |
405 _rangeCheck(this.length, start, length); | 405 _rangeCheck(this.length, start, length); |
406 return new _ByteArrayView(this, | 406 return new _ByteArrayView(this, |
407 start * this.bytesPerElement(), | 407 start * this.bytesPerElement(), |
408 length * this.bytesPerElement()); | 408 length * this.bytesPerElement()); |
409 } | 409 } |
410 | 410 |
411 List<int> toList() { | 411 List<int> toList({ bool growable: false }) { |
412 return new List<int>.from(this); | 412 return new List<int>.from(this, growable: growable); |
413 } | 413 } |
414 | 414 |
415 Set<int> toSet() { | 415 Set<int> toSet() { |
416 return new Set<int>.from(this); | 416 return new Set<int>.from(this); |
417 } | 417 } |
418 | 418 |
419 int _length() native "ByteArray_getLength"; | 419 int _length() native "ByteArray_getLength"; |
420 | 420 |
421 void _setRange(int startInBytes, int lengthInBytes, | 421 void _setRange(int startInBytes, int lengthInBytes, |
422 _ByteArrayBase from, int startFromInBytes) | 422 _ByteArrayBase from, int startFromInBytes) |
(...skipping 2261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2684 ByteArray asByteArray([int start = 0, int length]) { | 2684 ByteArray asByteArray([int start = 0, int length]) { |
2685 if (length == null) { | 2685 if (length == null) { |
2686 length = this.lengthInBytes(); | 2686 length = this.lengthInBytes(); |
2687 } | 2687 } |
2688 _rangeCheck(this.length, start, length); | 2688 _rangeCheck(this.length, start, length); |
2689 return _array.subByteArray(_offset + start, length); | 2689 return _array.subByteArray(_offset + start, length); |
2690 } | 2690 } |
2691 | 2691 |
2692 static const int _BYTES_PER_ELEMENT = 8; | 2692 static const int _BYTES_PER_ELEMENT = 8; |
2693 } | 2693 } |
OLD | NEW |