Source code: com/anotherbigidea/io/CountingOutputStream.java
1 package com.anotherbigidea.io;
2
3 import java.io.OutputStream;
4
5 /**
6 * An OutputStream that provides a count of the bytes written.
7 *
8 * @author nick
9 */
10 public abstract class CountingOutputStream extends OutputStream {
11
12 protected int mCount = 0;
13
14 /**
15 * @return the bytes-written counter
16 */
17 public int getCount() {
18 return mCount;
19 }
20
21 /**
22 * Set the counter.
23 */
24 public void setCount( int count ) {
25 mCount = count;
26 }
27 }