Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: jdbc setBinaryStream Date: Sun, 30 Nov 2014 00:07:36 +0000 (UTC) Organization: A noiseless patient Spider Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 30 Nov 2014 00:07:36 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="1426"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19CwwR5an+5OMpVi+zCiO26f0jbE5LpTvU=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:MEqEgL3CpE3RqrCxycN9/gw+O14= Xref: csiph.com comp.lang.java.programmer:30452 On Sat, 29 Nov 2014 20:36:40 +0000, Andreas Leitgeb wrote: > In hindsight (now that I've solved my own "puzzle"), the > ByteArray*Stream helped you in two ways: first, to do the rather > unexpectedly necessary text<->bytes conversion, > I could be wrong, but I don't think any conversion is needed or done: AFAIK a text field is simply an array of bytes that's as big as needed to contain an arbitrary amount of data and the streams just transfer raw bytes. I throw complete MIME encoded message bodies into a text fields when archiving a message and, when I need to look at an archived message, its sucked out, attached to a newly built covering message as a whole e-mail message and sent to my normal mail account so I can open it with my usual mail reader. I never had problems accessing all the MIME parts in the archived message. None of them have ever shown signs of being garbled by character code translations. Binary types, e.g. JPG images, open as normal. > ByteArrayInputStream has conveniently implemented available() as needed > at least by informix jdbc-drivers. (as I just learnt...) > I've never looked at that because I haven't needed to use it. All I care about, which I did check during initial testing, is that the same number of bytes are present before and after either transfer direction. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |