Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 69424 invoked from network); 28 Nov 2006 09:44:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2006 09:44:40 -0000 Received: (qmail 25415 invoked by uid 500); 28 Nov 2006 09:44:48 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 25408 invoked by uid 500); 28 Nov 2006 09:44:48 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 25399 invoked by uid 99); 28 Nov 2006 09:44:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 01:44:48 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jukka.zitting@gmail.com designates 66.249.82.238 as permitted sender) Received: from [66.249.82.238] (HELO wx-out-0506.google.com) (66.249.82.238) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 01:44:36 -0800 Received: by wx-out-0506.google.com with SMTP id i28so1931373wxd for ; Tue, 28 Nov 2006 01:44:16 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=czoj3OjO6V6RvIncpuXW+CjYBh4ae6ZdNzPxNdSiYFJDL7tYu3HaEosbjP5kOYQIuza/NX/ZiCVuvsP7gCzZGUb9IYfMjoOfJCFUEzprkuPTDn5HyHFgOuN0sqy77wctTmz0Y+J8JeqSbsQC3duA7Eo7pX/TTL8yh0iJaxrZkmw= Received: by 10.90.115.4 with SMTP id n4mr507005agc.1164707055904; Tue, 28 Nov 2006 01:44:15 -0800 (PST) Received: by 10.90.27.7 with HTTP; Tue, 28 Nov 2006 01:44:10 -0800 (PST) Message-ID: <510143ac0611280144r29684aceofbfea82b4105190b@mail.gmail.com> Date: Tue, 28 Nov 2006 11:44:10 +0200 From: "Jukka Zitting" To: users@jackrabbit.apache.org Subject: Re: Retrieving binary content In-Reply-To: <2f35a2640611280131t452b8cdel8963c0a81bb1a7bf@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2f35a2640611280112w39f0644em631bf26ac21c4404@mail.gmail.com> <510143ac0611280123w5ef2c53cu3f4941e5b3154c1a@mail.gmail.com> <2f35a2640611280131t452b8cdel8963c0a81bb1a7bf@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, On 11/28/06, Ted Roeloffzen wrote: > And how do I read the actual data with that inputstream? It's a standard java.io.InputStream. See the javadocs for example at http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html. A common pattern I use when processing stream data is: InputStream data = ...; try { byte[] buffer = new byte[BUFFER_SIZE]; for (int n = data.read(buffer); n != -1; n = data.read(buffer)) { // process n bytes of data in buffer } } finally { data.close(); } Note especially the finally branch used to guarantee that the stream gets closed even if an error occurs. > Sorry if this is a stupid question, but i'm not that experienced. No problem, stupid is the one who doesn't ask. :-) BR, Jukka Zitting