OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * Builds a list of bytes, allowing bytes and lists of bytes to be added at the | 8 * Builds a list of bytes, allowing bytes and lists of bytes to be added at the |
9 * end. | 9 * end. |
10 * | 10 * |
(...skipping 27 matching lines...) Expand all Loading... |
38 /** | 38 /** |
39 * Append [byte] to the current contents of the builder. | 39 * Append [byte] to the current contents of the builder. |
40 * | 40 * |
41 * The [byte] will be bit-representation truncated to the range 0 .. 255. | 41 * The [byte] will be bit-representation truncated to the range 0 .. 255. |
42 */ | 42 */ |
43 void addByte(int byte); | 43 void addByte(int byte); |
44 | 44 |
45 /** | 45 /** |
46 * Returns the contents of `this` and clears `this`. | 46 * Returns the contents of `this` and clears `this`. |
47 * | 47 * |
48 * The list returned is a view of the the internal buffer, limited to the | 48 * The list returned is a view of the internal buffer, limited to the |
49 * [length]. | 49 * [length]. |
50 */ | 50 */ |
51 List<int> takeBytes(); | 51 List<int> takeBytes(); |
52 | 52 |
53 /** | 53 /** |
54 * Returns a copy of the current contents of the builder. | 54 * Returns a copy of the current contents of the builder. |
55 * | 55 * |
56 * Leaves the contents of the builder intact. | 56 * Leaves the contents of the builder intact. |
57 */ | 57 */ |
58 List<int> toBytes(); | 58 List<int> toBytes(); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 bool get isEmpty => _length == 0; | 198 bool get isEmpty => _length == 0; |
199 | 199 |
200 bool get isNotEmpty => _length != 0; | 200 bool get isNotEmpty => _length != 0; |
201 | 201 |
202 void clear() { | 202 void clear() { |
203 _length = 0; | 203 _length = 0; |
204 _chunks.clear(); | 204 _chunks.clear(); |
205 } | 205 } |
206 } | 206 } |
OLD | NEW |