| 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 part of dart.crypto; |
| 6 |
| 5 class _LineWrappingStringBuffer { | 7 class _LineWrappingStringBuffer { |
| 6 _LineWrappingStringBuffer(int this._lineLength) : _sb = new StringBuffer(); | 8 _LineWrappingStringBuffer(int this._lineLength) : _sb = new StringBuffer(); |
| 7 | 9 |
| 8 void add(String s) { | 10 void add(String s) { |
| 9 if (_lineLength != null && _currentLineLength == _lineLength) { | 11 if (_lineLength != null && _currentLineLength == _lineLength) { |
| 10 _sb.add('\r\n'); | 12 _sb.add('\r\n'); |
| 11 _currentLineLength = 0; | 13 _currentLineLength = 0; |
| 12 } | 14 } |
| 13 _sb.add(s); | 15 _sb.add(s); |
| 14 _currentLineLength++; | 16 _currentLineLength++; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 var b1 = bytes[i + 1] & 0xff; | 67 var b1 = bytes[i + 1] & 0xff; |
| 66 result.add(table[b0 >> 2]); | 68 result.add(table[b0 >> 2]); |
| 67 result.add(table[((b0 << 4) | (b1 >> 4)) & 0x3f]); | 69 result.add(table[((b0 << 4) | (b1 >> 4)) & 0x3f]); |
| 68 result.add(table[(b1 << 2) & 0x3f]); | 70 result.add(table[(b1 << 2) & 0x3f]); |
| 69 result.add('='); | 71 result.add('='); |
| 70 } | 72 } |
| 71 | 73 |
| 72 return result.toString(); | 74 return result.toString(); |
| 73 } | 75 } |
| 74 } | 76 } |
| OLD | NEW |