pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: BLOB help - yes I've read around!
Date: Tue, 07 Apr 2009 23:41:53 +0200
Message-ID: <grgham$q84$1@ger.gmane.org> (raw)
In-Reply-To: <49DBC6DC.5030609@yahoo.co.uk>
References: <49DB559F.3030805@yahoo.co.uk>
	<200904071657.08065.achill@matrix.gatewaynet.com>
	<49DB5D63.5040103@yahoo.co.uk>
	<grfoia$t7m$1@ger.gmane.org>
	<49DBC6DC.5030609@yahoo.co.uk>

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.

Thomas




view thread (10+ messages)  latest in thread

Message-ID: <grgham$q84$1@ger.gmane.org>
Permalink:  ../grgham$q84$1@ger.gmane.org/
Also on:    postgresql.org/message-id/grgham$q84$1@ger.gmane.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: BLOB help - yes I've read around!
  In-Reply-To: <grgham$q84$1@ger.gmane.org>
  References: <49DB559F.3030805@yahoo.co.uk> <200904071657.08065.achill@matrix.gatewaynet.com> <49DB5D63.5040103@yahoo.co.uk> <grfoia$t7m$1@ger.gmane.org> <49DBC6DC.5030609@yahoo.co.uk> <grgham$q84$1@ger.gmane.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox