/* * Created on Jan 23, 2008 * */ package jPDFNotesSamples.upload; import java.io.IOException; import java.io.OutputStream; public class ByteCounterStream extends OutputStream { private int m_Counter; public ByteCounterStream () throws Exception { m_Counter = 0; } public void write(int b) throws IOException { ++m_Counter; } public void write(byte[] b) throws IOException { m_Counter += b.length; } public void write(byte[] b, int off, int len) throws IOException { m_Counter += len; } public int getCounter() { return m_Counter; } }