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

Unified Diff: lib/protobuf/runtime/mock_io.dart

Issue 10595002: Protocol Buffer runtime library and 'protoc' plugin (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Work around http://code.google.com/p/dart/issues/detail?id=3806 Created 8 years, 6 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 | « lib/protobuf/runtime/WireFormat.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/protobuf/runtime/mock_io.dart
diff --git a/lib/protobuf/runtime/mock_io.dart b/lib/protobuf/runtime/mock_io.dart
new file mode 100644
index 0000000000000000000000000000000000000000..899249f5c31587c0aab1a6d1b718cd6e70c7f934
--- /dev/null
+++ b/lib/protobuf/runtime/mock_io.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2012, 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.
+
+/**
+ * As needed mock alternative to dart:io for environments
+ * where dart:io is unavailable.
+ */
+class InputStream {
+ int available() {
+ throw new UnsupportedOperationException(
+ "Method InputStream.available() not available");
+ }
+ bool get closed() {
+ throw new UnsupportedOperationException(
+ "Method InputStream.closed() not available");
+ }
+ List<int> read([int readSize]) {
+ throw new UnsupportedOperationException(
+ "Method InputStream.read() not available");
+ }
+ void set onClosed(void callback()) {
+ throw new UnsupportedOperationException(
+ "Setter InputStream.onClosed() not available");
+ }
+ void set onData(void callback()) {
+ throw new UnsupportedOperationException(
+ "Setter InputStream.onData not available");
+ }
+ void set onError(void callback(Exception e)) {
+ throw new UnsupportedOperationException(
+ "Setter InputStream.onError not available");
+ }
+}
« no previous file with comments | « lib/protobuf/runtime/WireFormat.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698