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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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
« no previous file with comments | « sdk/lib/io/http_session.dart ('k') | sdk/lib/io/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/input_stream.dart
diff --git a/sdk/lib/io/input_stream.dart b/sdk/lib/io/input_stream.dart
index 8db5e190a3667da3e3694d6679df1e8f9bc62c7c..81ba090198976b9f45fce095d95b28950cb88ace 100644
--- a/sdk/lib/io/input_stream.dart
+++ b/sdk/lib/io/input_stream.dart
@@ -115,141 +115,6 @@ class Encoding {
}
-/**
- * A string input stream wraps a basic input stream and supplies
- * string data. This data can be read either as string chunks or as
- * lines separated by line termination character sequences.
- */
-abstract class StringInputStream {
- /**
- * Decodes a binary input stream into characters using the specified
- * encoding.
- */
- factory StringInputStream(InputStream input,
- [Encoding encoding = Encoding.UTF_8]) {
- return new _StringInputStream(input, encoding);
- }
-
- /**
- * Reads up to [len] characters from the stream. if [len] is not
- * specified reads as many characters as is available from the
- * stream. If no data is available null will be returned.
- */
- String read([int len]);
-
- /**
- * Reads the next line from the stream. The line ending characters
- * will not be part of the returned string. If a full line is not
- * available null will be returned.
- */
- String readLine();
-
- /**
- * Returns the number of characters available for immediate
- * reading. Note that this includes all characters that will be in
- * the String returned from [read] this includes line breaking
- * characters. If [readLine] is used for reading one can observe
- * less characters being returned as the line breaking characters
- * are discarded.
- */
- int available();
-
- /**
- * Returns whether the stream has been closed. There might still be
- * more data to read.
- */
- bool get closed;
-
- /**
- * Returns the encoding used to decode the binary data into characters.
- */
- Encoding get encoding;
-
- /**
- * Sets the handler that gets called when data is available. The two
- * handlers [onData] and [onLine] are mutually exclusive
- * and setting one will remove the other.
- */
- void set onData(void callback());
-
- /**
- * Sets the handler that gets called when a line is available. The
- * two handlers [onData] and [onLine] are mutually
- * exclusive and setting one will remove the other.
- */
- void set onLine(void callback());
-
- /**
- * Sets the handler that gets called when there will be no more data
- * available in the stream.
- */
- void set onClosed(void callback());
-
- /**
- * Sets the handler that gets called when the underlying
- * communication channel gets into some kind of error situation.
- */
- void set onError(void callback(e));
-}
-
-
-/**
- * A chunked input stream wraps a basic input stream and supplies
- * binary data in configurable chunk sizes.
- */
-abstract class ChunkedInputStream {
- /**
- * Adds buffering to an input stream and provide the ability to read
- * the data in known size chunks.
- */
- factory ChunkedInputStream(InputStream input, [int chunkSize = 0]) {
- return new _ChunkedInputStream(input, chunkSize);
- }
-
- /**
- * Reads [chunkSize] bytes from the stream. If [chunkSize] bytes are
- * not currently available null is returned. When the stream is
- * closed the last call can return with less than [chunkSize] bytes.
- */
- List<int> read();
-
- /**
- * Returns whether the stream has been closed. There might still be
- * more data to read.
- */
- bool get closed;
-
- /**
- * Returns the chunk size used by this stream.
- */
- int get chunkSize;
-
- /**
- * Sets the chunk size used by this stream.
- */
- void set chunkSize(int chunkSize);
-
- /**
- * Sets the handler that gets called when at least [chunkSize] bytes
- * of data is available or the underlying stream has been closed and
- * there is still unread data.
- */
- void set onData(void callback());
-
- /**
- * Sets the handler that gets called when there will be no more data
- * available in the stream.
- */
- void set onClosed(void callback());
-
- /**
- * Sets the handler that gets called when the underlying
- * communication channel gets into some kind of error situation.
- */
- void set onError(void callback(e));
-}
-
-
class StreamException implements Exception {
const StreamException([String this.message = ""]);
const StreamException.streamClosed() : message = "Stream closed";
« no previous file with comments | « sdk/lib/io/http_session.dart ('k') | sdk/lib/io/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698