public void write(byte[] buf,int off,int len) throws IOException {
  output.write(buf,off,len);
  bytesWritten+=len;
}

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