Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 741BD6330FF for ; Tue, 7 Apr 2009 18:54:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 38955-10 for ; Tue, 7 Apr 2009 18:53:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp107.mail.mud.yahoo.com (smtp107.mail.mud.yahoo.com [209.191.85.217]) by mail.postgresql.org (Postfix) with SMTP id BE34E634268 for ; Tue, 7 Apr 2009 18:53:57 -0300 (ADT) Received: (qmail 93451 invoked from network); 7 Apr 2009 21:53:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=UxtMUNqCdCp5qgV/MQfxfnqEImSaMa3F46wQ1izq2cfhVO23MANk9ejzQQ8TccDiV99S18bLNwjArpLoE4NvUv6UQj7TGF87JwGYSMtnIMcrdsEsmHSVh7MzZst8Al36AeeqpadVtgTY4dVxooLqHEVLH/+eizj61Dh06b8iEDE= ; Received: from unknown (HELO ?192.168.1.2?) (mail_4brad@121.73.20.162 with plain) by smtp107.mail.mud.yahoo.com with SMTP; 7 Apr 2009 21:53:56 -0000 X-YMail-OSG: LX1hMhwVM1lbNziwztDVGh_7GzsMgJ7.F3ii6Ux54p2CFGSZtXUmertuCXXwMVdIPbUb6QHc5PGq_.l8ZvAdB854TnNdgrmFtIvL5gNdEBPMdIFibhTZAdJnWyAWiNxMa7pXevvxnYfeEj35Com5ZRazVpJHoTlGL6TBt78edmTo1XanLzcINdhqzhmvF4hTFGwk1hy2zuGdVUcVMaDZ9YK0XUnyDzEd4iISbB_taptcKHU3C8pSFCBrvcMHJzsGFrw_sws_uueYrtKCfXcDRfbvBrznQKUOChZ_Ed6e.lfUCJz5nbyM X-Yahoo-Newman-Property: ymail-3 Message-ID: <49DBCBC2.6080402@yahoo.co.uk> Date: Wed, 08 Apr 2009 09:55:14 +1200 From: Brad Milne User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org CC: Thomas Kellerer Subject: Re: BLOB help - yes I've read around! References: <49DB559F.3030805@yahoo.co.uk> <200904071657.08065.achill@matrix.gatewaynet.com> <49DB5D63.5040103@yahoo.co.uk> <49DBC6DC.5030609@yahoo.co.uk> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=AWL=0.000 X-Spam-Level: X-Archive-Number: 200904/27 X-Sequence-Number: 19474 Thomas Kellerer wrote: > Brad Milne wrote on 07.04.2009 23:34: >> For completeness, here is the setter again with a couple of fixes: >> >> stmt.setBinaryStream(2,in,in.available()); > > Do not use availabe() > > This will *not* give you the number of bytes that are "available" in > the stream. > > Read the Javadocs carefully: it will give you the number of bytes that > can be /read without blocking/ > > Most of the time this will not be the length of the stream. > Good point Thomas, I hear you. I shouldn't have written that hear as others could follow that. In my implementation it is ok as the stream is complete prior to persisting it. I have an AudioInputStream object, but it is always complete. If you think I should be therefore using a different method/db object then I'd be pleased to hear. Thanks Brad