Re: Integer2String Covnersation

2009-03-11 Thread Yonik Seeley
On Wed, Mar 11, 2009 at 10:25 AM, Allahbaksh Mohammedali Asadullah wrote: > Hi, > I didn't get what exactly does shifiting 24 times and shifing 12 times does. > Is there any Character at that value or is there some differenciator? > Can some one go in bit details. > Regards. That's just bit twid

RE: Integer2String Covnersation

2009-03-11 Thread Allahbaksh Mohammedali Asadullah
Yonik Seeley Sent: Wednesday, March 11, 2009 7:35 PM To: java-user@lucene.apache.org Subject: Re: Integer2String Covnersation On Wed, Mar 11, 2009 at 9:54 AM, Allahbaksh Mohammedali Asadullah wrote: > Hi all, > Can any one explain How function integer2String works. > >  public static in

Re: Integer2String Covnersation

2009-03-11 Thread Yonik Seeley
On Wed, Mar 11, 2009 at 9:54 AM, Allahbaksh Mohammedali Asadullah wrote: > Hi all, > Can any one explain How function integer2String works. > >  public static int int2sortableStr(int val, char[] out, int offset) { > >    val += Integer.MIN_VALUE; This maps MIN_VALUE to 0 and MAX_VALUE to 0xff

Integer2String Covnersation

2009-03-11 Thread Allahbaksh Mohammedali Asadullah
Hi all, Can any one explain How function integer2String works. public static int int2sortableStr(int val, char[] out, int offset) { val += Integer.MIN_VALUE; out[offset++] = (char)(val >>> 24); out[offset++] = (char)((val >>> 12) & 0x0fff); out[offset++] = (char)(val & 0x0ff