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

Unified Diff: runtime/bin/input_stream.dart

Issue 10938010: Switch from interfaces to abstract classes in dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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: runtime/bin/input_stream.dart
diff --git a/runtime/bin/input_stream.dart b/runtime/bin/input_stream.dart
index 38e8f1d81e3d0fa473d07af41863ca2682790c8e..29f182841ee2c66676f6d847e4e46c383009ee4e 100644
--- a/runtime/bin/input_stream.dart
+++ b/runtime/bin/input_stream.dart
@@ -31,7 +31,7 @@
* Always set up appropriate handlers when using input streams.
*
*/
-interface InputStream {
+abstract class InputStream {
/**
* Reads data from the stream. Returns a system allocated buffer
* with up to [len] bytes. If no value is passed for [len] all
@@ -114,12 +114,15 @@ class Encoding {
* string data. This data can be read either as string chunks or as
* lines separated by line termination character sequences.
*/
-interface StringInputStream default _StringInputStream {
+abstract class StringInputStream {
/**
* Decodes a binary input stream into characters using the specified
* encoding. The default encoding is UTF-8 - `Encoding.UTF_8`.
Søren Gjesse 2012/09/18 09:34:16 No need for documentation of the default value.
Mads Ager (google) 2012/09/18 10:46:39 Done.
*/
- StringInputStream(InputStream input, [Encoding encoding]);
+ factory StringInputStream(InputStream input,
+ [Encoding encoding = Encoding.UTF_8]) {
+ return new _StringInputStream(input, encoding);
+ }
/**
* Reads as many characters as is available from the stream. If no data is
@@ -187,12 +190,14 @@ interface StringInputStream default _StringInputStream {
* A chunked input stream wraps a basic input stream and supplies
* binary data in configurable chunk sizes.
*/
-interface ChunkedInputStream default _ChunkedInputStream {
+abstract class ChunkedInputStream {
/**
* Adds buffering to an input stream and provide the ability to read
* the data in known size chunks.
*/
- ChunkedInputStream(InputStream input, [int chunkSize]);
+ factory ChunkedInputStream(InputStream input, [int chunkSize = 0]) {
+ return new _ChunkedInputStream(input, chunkSize);
+ }
/**
* Reads [chunkSize] bytes from the stream. If [chunkSize] bytes are

Powered by Google App Engine
This is Rietveld 408576698