Author: michiel
Date: 2009-07-06 16:34:38 +0200 (Mon, 06 Jul 2009)
New Revision: 36583
Modified:
mmbase/trunk/core/src/main/java/org/mmbase/util/externalprocess/StreamCopyThread.java
Log:
exposed 'count'
Modified:
mmbase/trunk/core/src/main/java/org/mmbase/util/externalprocess/StreamCopyThread.java
===================================================================
---
mmbase/trunk/core/src/main/java/org/mmbase/util/externalprocess/StreamCopyThread.java
2009-07-06 14:34:15 UTC (rev 36582)
+++
mmbase/trunk/core/src/main/java/org/mmbase/util/externalprocess/StreamCopyThread.java
2009-07-06 14:34:38 UTC (rev 36583)
@@ -60,6 +60,8 @@
*/
private boolean finished = false;
+ private long count = 0;
+
/**
* Create a thread to copy bytes fro one strea to the other
*
@@ -119,6 +121,7 @@
return;
}
+ count = 0;
int size = 0;
//this buffer has nothing to do with the OS buffer
byte[] buffer = new byte[StreamCopyThread.BUFFER_SIZE];
@@ -128,6 +131,7 @@
writer.write(buffer, 0, size);
writer.flush();
}
+ count += size;
//log.debug("StreamCopy " + this.getName() + " read " + size +
" bytes from input and wrote to output." );
//Maybe we should reset variables
@@ -174,6 +178,10 @@
return finished;
}
+ public long getCount() {
+ return count;
+ }
+
/**
* By calling this method the calling thread will wait until this thread is
* finished copying bytes
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs