com.izforge.izpack.compiler
Class ByteCountingOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bycom.izforge.izpack.compiler.ByteCountingOutputStream

public class ByteCountingOutputStream
extends java.io.OutputStream

Stream which countes the bytes written through it. Be sure to flush before checking size.


Field Summary
private  long count
           
private  java.io.OutputStream os
           
 
Constructor Summary
ByteCountingOutputStream(java.io.OutputStream os)
           
 
Method Summary
 void close()
           
 void flush()
           
 long getByteCount()
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

private long count

os

private java.io.OutputStream os
Constructor Detail

ByteCountingOutputStream

public ByteCountingOutputStream(java.io.OutputStream os)
Method Detail

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

getByteCount

public long getByteCount()