public void write(byte[] buf) throws IOException {
  output.write(buf);
  bytesWritten+=buf.length;
}

public void write ( byte [ ] buf ) throws IOException { output . write ( buf ) ; bytesWritten += buf . length ; }
counts the written bytes .
