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

Unified Diff: pkg/http/lib/src/byte_stream.dart

Issue 810223002: Remove the http package from the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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: pkg/http/lib/src/byte_stream.dart
diff --git a/pkg/http/lib/src/byte_stream.dart b/pkg/http/lib/src/byte_stream.dart
deleted file mode 100644
index f3546c73e9920d2667815d14e1b2e7880a31e579..0000000000000000000000000000000000000000
--- a/pkg/http/lib/src/byte_stream.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library byte_stream;
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:typed_data';
-
-import 'utils.dart';
-
-/// A stream of chunks of bytes representing a single piece of data.
-class ByteStream extends StreamView<List<int>> {
- ByteStream(Stream<List<int>> stream)
- : super(stream);
-
- /// Returns a single-subscription byte stream that will emit the given bytes
- /// in a single chunk.
- factory ByteStream.fromBytes(List<int> bytes) =>
- new ByteStream(streamFromIterable([bytes]));
-
- /// Collects the data of this stream in a [Uint8List].
- Future<Uint8List> toBytes() {
- var completer = new Completer();
- var sink = new ByteConversionSink.withCallback((bytes) =>
- completer.complete(new Uint8List.fromList(bytes)));
- listen(sink.add, onError: completer.completeError, onDone: sink.close,
- cancelOnError: true);
- return completer.future;
- }
-
- /// Collect the data of this stream in a [String], decoded according to
- /// [encoding], which defaults to `UTF8`.
- Future<String> bytesToString([Encoding encoding=UTF8]) =>
- encoding.decodeStream(this);
-
- Stream<String> toStringStream([Encoding encoding=UTF8]) =>
- transform(encoding.decoder);
-}
« no previous file with comments | « pkg/http/lib/src/base_response.dart ('k') | pkg/http/lib/src/client.dart » ('j') | pkg/pkg.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698