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

Unified Diff: sdk/lib/io/string_transformer.dart

Issue 12610006: Renamed StreamSink to EventSink. Renamed signalError to addError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed inheritance back! Now create StreamSink instead of EventSink where we create them. Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/io/string_transformer.dart
diff --git a/sdk/lib/io/string_transformer.dart b/sdk/lib/io/string_transformer.dart
index 2b02639f474f2cb64d2c5a5a75b346f43a20bbcf..89b3598da84df75ef9a6ba1b3f4d8474400cb156 100644
--- a/sdk/lib/io/string_transformer.dart
+++ b/sdk/lib/io/string_transformer.dart
@@ -167,7 +167,7 @@ class LineTransformer extends StreamEventTransformer<String, String> {
StringBuffer _buffer = new StringBuffer();
String _carry;
- void _handle(String data, StreamSink<String> sink, bool isClosing) {
+ void _handle(String data, EventSink<String> sink, bool isClosing) {
if (_carry != null) {
data = _carry.concat(data);
_carry = null;
@@ -209,11 +209,11 @@ class LineTransformer extends StreamEventTransformer<String, String> {
}
}
- void handleData(String data, StreamSink<String> sink) {
+ void handleData(String data, EventSink<String> sink) {
_handle(data, sink, false);
}
- void handleDone(StreamSink<String> sink) {
+ void handleDone(EventSink<String> sink) {
_handle("", sink, true);
sink.close();
}
@@ -226,7 +226,7 @@ abstract class _SingleByteDecoder
_SingleByteDecoder(this._replacementChar);
- void handleData(List<int> data, StreamSink<String> sink) {
+ void handleData(List<int> data, EventSink<String> sink) {
var buffer = new List<int>(data.length);
for (int i = 0; i < data.length; i++) {
int char = _decodeByte(data[i]);
@@ -260,10 +260,10 @@ class _Latin1Decoder extends _SingleByteDecoder {
abstract class _SingleByteEncoder
extends StreamEventTransformer<String, List<int>> {
- void handleData(String data, StreamSink<List<int>> sink) {
+ void handleData(String data, EventSink<List<int>> sink) {
var bytes = _encode(data);
if (bytes == null) {
- sink.signalError(
+ sink.addError(
new AsyncError(
new FormatException("Invalid character for encoding")));
sink.close();
@@ -314,7 +314,7 @@ class _WindowsCodePageEncoder extends _SingleByteEncoder {
// Utility class for decoding Windows current code page data delivered
// as a stream of bytes.
class _WindowsCodePageDecoder extends StreamEventTransformer<List<int>, String> {
- void handleData(List<int> data, StreamSink<String> sink) {
+ void handleData(List<int> data, EventSink<String> sink) {
sink.add(_decodeBytes(data));
}

Powered by Google App Engine
This is Rietveld 408576698