jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@gmail.com>
Subject Re: [OCM] Binary values from byte[] field
Date Wed, 12 Sep 2007 13:54:58 GMT
Hi,

Am Mittwoch, den 12.09.2007, 20:22 +0700 schrieb Hendrik Beck (camunda):
>   String value = new String(byte[]) propValue);
>   valueFactory.createValue(value);

Isn't this wrong anyway ? If we convert the binary data to String at
all, we should use ISO-8859-1 as the charset to ensure identity
conversion. But this seems somewhat strange as the data actually really
is binary so, we should do

   InputStream ins = new ByteArrayInputStream((byte[]) propValue);
   valueFactory.createValue(ins);

Likewise reading the value would consist of reading the value as a
stream into a byte[] and return that array.

What do you think ?

Regards
Felix

> 
> Is it possible that this operation is being done using the wrong charset for
> my file?
> 
> Well, that's just a wild guess, I could honestly be totally wrong. I would
> be thankful for any pointers. Are there people doing the same, like storing
> binaries with OCM using byte[] for the jcr:data? Am I missing something?
> 
> 
> Thanks in advance
> Hendrik
> 
> 


Mime
View raw message