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 import 'dart:typed_data' show Uint16List; |
| 6 |
5 @patch class StringBuffer { | 7 @patch class StringBuffer { |
6 static const int _BUFFER_SIZE = 64; | 8 static const int _BUFFER_SIZE = 64; |
7 static const int _PARTS_TO_COMPACT = 128; | 9 static const int _PARTS_TO_COMPACT = 128; |
8 static const int _PARTS_TO_COMPACT_SIZE_LIMIT = _PARTS_TO_COMPACT * 8; | 10 static const int _PARTS_TO_COMPACT_SIZE_LIMIT = _PARTS_TO_COMPACT * 8; |
9 | 11 |
10 /** | 12 /** |
11 * When strings are written to the string buffer, we add them to a | 13 * When strings are written to the string buffer, we add them to a |
12 * list of string parts. | 14 * list of string parts. |
13 */ | 15 */ |
14 List<String> _parts; | 16 List<String> _parts; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 _partsCodeUnitsSinceCompaction = 0; | 178 _partsCodeUnitsSinceCompaction = 0; |
177 _partsCompactionIndex = _parts.length; | 179 _partsCompactionIndex = _parts.length; |
178 } | 180 } |
179 | 181 |
180 /** | 182 /** |
181 * Create a [String] from the UFT-16 code units in buffer. | 183 * Create a [String] from the UFT-16 code units in buffer. |
182 */ | 184 */ |
183 static String _create(Uint16List buffer, int length, bool isLatin1) | 185 static String _create(Uint16List buffer, int length, bool isLatin1) |
184 native "StringBuffer_createStringFromUint16Array"; | 186 native "StringBuffer_createStringFromUint16Array"; |
185 } | 187 } |
OLD | NEW |