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

Side by Side Diff: lib/scalarlist/byte_arrays.dart

Issue 11098065: Fix bug in ByteArray.subByteArray implementation for omitted length. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « no previous file | runtime/lib/byte_array.dart » ('j') | runtime/lib/byte_array.dart » ('J')
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 /** 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 15 matching lines...) Expand all
26 int lengthInBytes(); 26 int lengthInBytes();
27 27
28 /** 28 /**
29 * Returns a [ByteArray] _view_ of a portion of this byte array. 29 * Returns a [ByteArray] _view_ of a portion of this byte array.
30 * The returned byte array consists of [length] bytes starting 30 * The returned byte array consists of [length] bytes starting
31 * at position [start] in this byte array. The returned byte array 31 * at position [start] in this byte array. The returned byte array
32 * is backed by the same data as this byte array. In other words, 32 * is backed by the same data as this byte array. In other words,
33 * changes to the returned byte array are visible in this byte array 33 * changes to the returned byte array are visible in this byte array
34 * and vice-versa. 34 * and vice-versa.
35 * 35 *
36 * Throws [IndexOutOfRangeException] if [start] is negative, or if 36 * Throws [IndexOutOfRangeException] if [start] or [length] are negative, or
37 * `start + length` is greater than the length of this byte array. 37 * if `start + length` is greater than the length of this byte array.
38 * 38 *
39 * Throws [ArgumentError] if [length] is negative. 39 * Throws [ArgumentError] if [length] is negative.
40 */ 40 */
41 ByteArray subByteArray([int start, int length]); 41 ByteArray subByteArray([int start, int length]);
42 42
43 /** 43 /**
44 * Returns the (possibly negative) integer represented by the byte at the 44 * Returns the (possibly negative) integer represented by the byte at the
45 * specified [byteOffset] in this byte array, in two's complement binary 45 * specified [byteOffset] in this byte array, in two's complement binary
46 * representation. The return value will be between -128 and 127, inclusive. 46 * representation. The return value will be between -128 and 127, inclusive.
47 * 47 *
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 * [start] of the region is not divisible by 8. If, however, [array] 661 * [start] of the region is not divisible by 8. If, however, [array]
662 * is a view of another byte array, this constructor will throw 662 * is a view of another byte array, this constructor will throw
663 * [ArgumentError] if the implicit starting position in the 663 * [ArgumentError] if the implicit starting position in the
664 * "ultimately backing" byte array is not divisible by 8. In plain terms, 664 * "ultimately backing" byte array is not divisible by 8. In plain terms,
665 * this constructor throws [ArgumentError] if the specified 665 * this constructor throws [ArgumentError] if the specified
666 * region does not contain an integral number of "float64s," or if it 666 * region does not contain an integral number of "float64s," or if it
667 * is not "float64-aligned." 667 * is not "float64-aligned."
668 */ 668 */
669 external factory Float64List.view(ByteArray array, [int start, int length]); 669 external factory Float64List.view(ByteArray array, [int start, int length]);
670 } 670 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | runtime/lib/byte_array.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698