harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Khaschansky" <oleg.v.khaschan...@gmail.com>
Subject Re: [classlib][sql] RI's bug of SerialBlob.position(byte[] pattern, long start)?
Date Wed, 13 Dec 2006 13:45:28 GMT
> BTW, what does the another version
> of  position() method - position(Blob pattern, long start) - return in
> these cases?
I tried the following:
       byte[] buf = { 1,3,9,1,1,3,2,2,4,2,3,9,3,3 };
       SerialBlob blob = new SerialBlob(buf);

       byte[]  pattern = new byte[] { 1,2,3 };
       SerialBlob blob2 = new SerialBlob(pattern);
       long pos = blob.position(blob2, 1);
       System.out.println(pos);
and, again, it returned 9. It seems like it does exactly the same as
position(byte[] pattern, long start).

Regarding its implementation, it's possible to simply get the byte
array with pattern.getBytes(1, pattern.length()) and then use
position(byte[] pattern, long start) with the obtained byte array.

On 12/13/06, Alexei Zakharov <alexei.zakharov@gmail.com> wrote:
> Looks like the RI bug to me also. BTW, what does the another version
> of  position() method - position(Blob pattern, long start) - return in
> these cases?
>
> Thanks,
>
> 2006/12/13, Tim Ellison <t.p.ellison@gmail.com>:
> > Oleg Khaschansky wrote:
> > > I am not a guru, but my understanding is that RI behavior is
> > > errorneous. I'd say that from the client point of view BLOBs are just
> > > byte arrays. I suggest to do exact search instead of following RI.
> >
> > Same for me -- looks like the right answer but don't claim expert
> > knowledge in the area.
>
>
> --
> Alexei Zakharov,
> Intel ESSD
>

Mime
View raw message