X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 1E3F09FA383 for ; Wed, 13 Sep 2006 13:35:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 40505-08 for ; Wed, 13 Sep 2006 16:35:09 +0000 (UTC) X-Greylist: delayed 00:25:36.29586 by SQLgrey- Received: from smtp.ini.unizh.ch (dns.ini.unizh.ch [130.60.230.185]) by postgresql.org (Postfix) with ESMTP id B0E339FA0CC for ; Wed, 13 Sep 2006 13:35:08 -0300 (ADT) Received: from smtp.ini.unizh.ch (localhost [127.0.0.1]) by smtp.ini.unizh.ch (Postfix) with ESMTP id 6774385C5DD for ; Wed, 13 Sep 2006 18:09:30 +0200 (CEST) Received: by smtp.ini.unizh.ch (Postfix, from userid 499) id 4DBDA85C5FA; Wed, 13 Sep 2006 18:09:30 +0200 (CEST) Received: from acardona.lan.ini.unizh.ch (unknown [172.16.2.13]) (using TLSv1 with cipher EXP1024-RC4-SHA (56/128 bits)) (No client certificate requested) by smtp.ini.unizh.ch (Postfix) with ESMTP id BA64A85C5AE for ; Wed, 13 Sep 2006 18:09:26 +0200 (CEST) From: Albert Cardona To: pgsql-jdbc@postgresql.org Subject: Re: about monitoring the input stream Date: Wed, 13 Sep 2006 18:09:54 +0200 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609131809.55435.acardona@ini.phys.ethz.ch> X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/46 X-Sequence-Number: 15764 Marc, > Why don't you decorate the InputStream with some simple > CountingInputStream of yours, just like Oliver suggested? > Something very similar to: > private java.io.DataOutputStream#incCount() > If you are lazy you could even extend BufferInputStream; like this > you have just two read methods to override. The idea is not to modify the driver one bit in benefit of uncontroversial deployment of my application (TrakEM2 at http://www.ini.unizh.ch/~acardona/trackem2.html ). If java was lisp I would simply alter the register to replace the InputStream, but it isn't and/or I don't know how to use reflection to that extent (I don't know what would happen was I to replace the InputStream using reflection once a connection has been created). Therefore I ask for suggestions on how to monitor the downloading rate ... If there aren't any, well, tough luck! I'll have to live with it. Albert