Permalink
Browse files

Implemented getLength

  • Loading branch information...
felixge committed Apr 27, 2012
1 parent 19e95bf commit b49553700e6c92e3b0d9105b93f988e280cb324c
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/StreamCache.js
View
@@ -41,6 +41,12 @@ StreamCache.prototype.pipe = function(dest, options) {
return dest;
};
+StreamCache.prototype.getLength = function() {
+ return this._buffers.reduce(function(totalLength, buffer) {
+ return totalLength + buffer.length;
+ }, 0);
+};
+
StreamCache.prototype.end = function() {
this._dests.forEach(function(dest) {
dest.end();

0 comments on commit b495537

Please sign in to comment.