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

Unified Diff: packages/crypto/lib/src/digest_sink.dart

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 5 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 | « packages/crypto/lib/src/digest.dart ('k') | packages/crypto/lib/src/hash.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/crypto/lib/src/digest_sink.dart
diff --git a/packages/crypto/lib/src/digest_sink.dart b/packages/crypto/lib/src/digest_sink.dart
new file mode 100644
index 0000000000000000000000000000000000000000..48c85f5a157f4eb1963103746bb9b7ab4305183f
--- /dev/null
+++ b/packages/crypto/lib/src/digest_sink.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2015, 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.
+
+import 'digest.dart';
+
+/// A sink used to get a digest value out of `Hash.startChunkedConversion`.
+class DigestSink extends Sink<Digest> {
+ /// The value added to the sink, if any.
+ Digest get value {
+ assert(_value != null);
+ return _value;
+ }
+
+ Digest _value;
+
+ /// Adds [value] to the sink.
+ ///
+ /// Unlike most sinks, this may only be called once.
+ @override
+ void add(Digest value) {
+ assert(_value == null);
+ _value = value;
+ }
+
+ @override
+ void close() {
+ assert(_value != null);
+ }
+}
« no previous file with comments | « packages/crypto/lib/src/digest.dart ('k') | packages/crypto/lib/src/hash.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698