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 /** | 5 /** |
6 * A random-access sequence of bytes that also provides random access to | 6 * A random-access sequence of bytes that also provides random access to |
7 * the fixed-width integers and floating point numbers represented by | 7 * the fixed-width integers and floating point numbers represented by |
8 * those bytes. Byte arrays may be used to pack and unpack data from | 8 * those bytes. Byte arrays may be used to pack and unpack data from |
9 * external sources (such as networks or files systems), and to process | 9 * external sources (such as networks or files systems), and to process |
10 * large quantities of numerical data more efficiently than would be possible | 10 * large quantities of numerical data more efficiently than would be possible |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 * array and vice versa. If the [start] index of the region is not specified, | 391 * array and vice versa. If the [start] index of the region is not specified, |
392 * it defaults to zero (the first byte in the byte array). If the length is | 392 * it defaults to zero (the first byte in the byte array). If the length is |
393 * not specified, it defaults to null, which indicates that the view extends | 393 * not specified, it defaults to null, which indicates that the view extends |
394 * to the end of the byte array. | 394 * to the end of the byte array. |
395 */ | 395 */ |
396 external factory Uint8List.view(ByteArray array, [int start, int length]); | 396 external factory Uint8List.view(ByteArray array, [int start, int length]); |
397 } | 397 } |
398 | 398 |
399 | 399 |
400 /** | 400 /** |
| 401 * A fixed-length list of 8-bit unsigned integers that is viewable as a |
| 402 * [ByteArray]. For long lists, this implementation will be considerably |
| 403 * more space- and time-efficient than the default [List] implementation. |
| 404 * Indexed store clamps the value to range 0..0xFF. |
| 405 */ |
| 406 abstract class Uint8ClampedList implements List<int>, ByteArrayViewable { |
| 407 /** |
| 408 * Creates a [Uint8ClampedList] of the specified length (in elements), all of |
| 409 * whose elements are initially zero. |
| 410 */ |
| 411 external factory Uint8ClampedList(int length); |
| 412 |
| 413 /** |
| 414 * Creates a [Uint8ClampedList] _view_ of the specified region in the |
| 415 * specified byte [array]. Changes in the [Uint8List] will be visible in the |
| 416 * byte array and vice versa. If the [start] index of the region is not |
| 417 * specified, it defaults to zero (the first byte in the byte array). If the |
| 418 * length is not specified, it defaults to null, which indicates that the view |
| 419 * extends to the end of the byte array. |
| 420 */ |
| 421 external factory Uint8ClampedList.view(ByteArray array, |
| 422 [int start, int length]); |
| 423 } |
| 424 |
| 425 |
| 426 /** |
401 * A fixed-length list of 16-bit signed integers that is viewable as a | 427 * A fixed-length list of 16-bit signed integers that is viewable as a |
402 * [ByteArray]. For long lists, this implementation will be considerably | 428 * [ByteArray]. For long lists, this implementation will be considerably |
403 * more space- and time-efficient than the default [List] implementation. | 429 * more space- and time-efficient than the default [List] implementation. |
404 */ | 430 */ |
405 abstract class Int16List implements List<int>, ByteArrayViewable { | 431 abstract class Int16List implements List<int>, ByteArrayViewable { |
406 /** | 432 /** |
407 * Creates an [Int16List] of the specified length (in elements), all of | 433 * Creates an [Int16List] of the specified length (in elements), all of |
408 * whose elements are initially zero. | 434 * whose elements are initially zero. |
409 */ | 435 */ |
410 external factory Int16List(int length); | 436 external factory Int16List(int length); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 * [start] of the region is not divisible by 8. If, however, [array] | 688 * [start] of the region is not divisible by 8. If, however, [array] |
663 * is a view of another byte array, this constructor will throw | 689 * is a view of another byte array, this constructor will throw |
664 * [ArgumentError] if the implicit starting position in the | 690 * [ArgumentError] if the implicit starting position in the |
665 * "ultimately backing" byte array is not divisible by 8. In plain terms, | 691 * "ultimately backing" byte array is not divisible by 8. In plain terms, |
666 * this constructor throws [ArgumentError] if the specified | 692 * this constructor throws [ArgumentError] if the specified |
667 * region does not contain an integral number of "float64s," or if it | 693 * region does not contain an integral number of "float64s," or if it |
668 * is not "float64-aligned." | 694 * is not "float64-aligned." |
669 */ | 695 */ |
670 external factory Float64List.view(ByteArray array, [int start, int length]); | 696 external factory Float64List.view(ByteArray array, [int start, int length]); |
671 } | 697 } |
OLD | NEW |