Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 16194 invoked from network); 3 Jun 2008 15:55:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jun 2008 15:55:34 -0000 Received: (qmail 59870 invoked by uid 500); 3 Jun 2008 15:55:35 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 59775 invoked by uid 500); 3 Jun 2008 15:55:35 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 59764 invoked by uid 99); 3 Jun 2008 15:55:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 08:55:35 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of juliusdavies@gmail.com designates 64.233.184.226 as permitted sender) Received: from [64.233.184.226] (HELO wr-out-0506.google.com) (64.233.184.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2008 15:54:44 +0000 Received: by wr-out-0506.google.com with SMTP id 36so507083wra.24 for ; Tue, 03 Jun 2008 08:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=ZFjSUaC0+USh7zaYzPKbhC3yxo/z1qN0XiPvKesHaeY=; b=KqL9FkHOcUh6WGpXkCW/iqT3uPRGsNUcDmFPSpjs0tjrVUHS3X3egj3m+848sn0U/0hPbZnGJfVYDrLi/DitOuTnUmucou0riH0TWEDKXddSgDIypSoAI/rdnJ9wEq49pvMeat1/cPw/DQzYNH8fVtJjNv3rBLgur2gZ+H3q1WY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RUk5EJeIY+XEtLewQ6SL45fnchCLbwicPbR7BlnikyK/CzwDWrfonythvKnu1U58fXfOK9Y6Bgt6tfYokhHbx43Dta0owyuo5AtOY29E6GhYHxDaOZ2PlUePD5vciVm0Z3gJiqyX/tm4h78UaK8oit3eMJKcl/oW9PsLMZqH2js= Received: by 10.100.33.11 with SMTP id g11mr15701ang.28.1212508500914; Tue, 03 Jun 2008 08:55:00 -0700 (PDT) Received: by 10.100.105.19 with HTTP; Tue, 3 Jun 2008 08:55:00 -0700 (PDT) Message-ID: <598ad5b50806030855l303aa00dn99b1e9001b40acfb@mail.gmail.com> Date: Tue, 3 Jun 2008 08:55:00 -0700 From: "Julius Davies" To: "Commons Developers List" Subject: Re: [codec] Base64InputStream In-Reply-To: <598ad5b50805311152n50e22368m8c2774b2eeab38bf@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <598ad5b50805310006s420bcef1ke588ac5f70faeeeb@mail.gmail.com> <598ad5b50805311152n50e22368m8c2774b2eeab38bf@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Just to let people know: I'm writing a new Base64InputStream by using the ws-commons-util logic, but rearranging things to suit this kind of usage pattern: #1. in = new Base64InputStream(in, DECODE); #2. in = new Base64InputStream(in, ENCODE); The ws-commons-util logic is really slick. I really like it. (And it's so fast). This is a fun challenge. I'll post to the list in a week or two with any progress. yours, Julius On Sat, May 31, 2008 at 11:52 AM, Julius Davies wrote: > Hi, Jochen, > > > Thanks for pointing out that method. I was looking for a static > method. I didn't expect it to be an instance method! Anyway, now > that I've found it, ws-commons-util is the winner! > > > [16.203 seconds] ws-commons-util THE WINNER!!!! > > [21.946 seconds] not-yet-commons-ssl > > > (For some reason not-yet-commons-ssl starting running faster.... > weird. But sun, iharder, and openssl didn't change!) > > > Here's how I used ws-commons-util: > > FileInputStream fi = new FileInputStream(args[0]); > InputStream in = new BufferedInputStream(fi); > InputStreamReader reader = new InputStreamReader(in, "US-ASCII"); > char[] buf = new char[8192]; > Base64 b64 = new Base64(); > Writer w = b64.newDecoder(out); > > long start = System.currentTimeMillis(); > int c = reader.read(buf); > while (c >= 0) { > if (c > 0) { > w.write(buf, 0, c); > } > c = reader.read(buf); > } > long duration = System.currentTimeMillis() - start; > > > yours, > > Julius > > > On Sat, May 31, 2008 at 1:18 AM, Jochen Wiedmann > wrote: >> On Sat, May 31, 2008 at 9:06 AM, Julius Davies wrote: >> >>> I also tried to test with ws-common, but the Base64 library in there >>> doesn't have a streaming decoder, so I don't think it can handle a >>> 700MB file. >> >> And what do you think that >> >> http://ws.apache.org/commons/util/apidocs/org/apache/ws/commons/util/Base64.html#newDecoder(java.io.OutputStream) >> >> is? For performance tuning, increasing the underlying buffer might be important. >> >> Jochen >> >> -- yours, Julius Davies 250-592-2284 (Home) 250-893-4579 (Mobile) http://juliusdavies.ca/ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org