dev@fi.java.net

Re: C.25 again

From: Kristian Sons <kristian.sons_at_supporting.com>
Date: Tue, 12 Jan 2010 16:41:33 +0100

Hello!

Okay, now I understand the issue:
encodeNonZeroIntegerOnSecondBitFirstBitOne is only used for table
indices, so you always go into this method with an decreased value, thus
you don't have to decrease it anymore. The result is actually as
described in C.25 of the specification.

In the end it was my fault: I was confused about a namespace name index,
missing that the spec has a predefined entry in that table... :|

Thanks a lot!
   Kristian




> Hello Kristian!
>
> The Java implementation is standard compliant. That's what I was actually
> stating in the quoted message.
>
> Since the Java table is 0 and not 1 based, the Java implementation doesn't
> have to subtract 1 when writing an index and add 1 when reading in order to
> encode and decode everything correctly.
>
> So if you use 0 based arrays as vocabulary tables, you can write and read
> indexes the same ways as the Java implementation does it.
>
> With best regards,
> Arman
>
> Kristian Sons wrote:
>> Hi!
>>
>> I am implementing a C++ FI library and I ran into same problems as
>> Arman using the Java FI implementation as reference:
>>
>> >>>> As far as I can see C.25.2 implementation is correct. It doesn't
>> add +1
>> >>>> when reading 1-64 value range, because in the Java
>> implementation the
>> >>>> vocabulary tables are 0 based, so practically adding and
>> subtracting 1
>> >>>> while
>> >>>> reading/writing is not necessary. The same applies to other
>> ranges. It
>> >>>> adds
>> >>>> 64 instead of 65 as lower boundary for medium ranged values and
>> 8256
>> >>>> instead
>> >>>> of 8257 for high ranged values.
>>
>> So the Java implementation is not standard compliant? That seems
>> strange to me, since all the other methods seem to be compliant.
>>
>> Or did I missed something?
>>
>> Greetings,
>> Kristian
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_fi.dev.java.net
> For additional commands, e-mail: dev-help_at_fi.dev.java.net
>


-- 
Supporting GmbH
Chiemgaustr 62 / 81549 München / Germany
Sitz der Gesellschaft: München
Handelsregister: Amtsgericht München, HRB 181127
Geschäftsführung: Kristian Sons
tel     +49-89-20327854
fax     +49-89-20327853
mobile  +49-151-50987608
mail    kristian.sons_at_supporting.com
web     http://www.supporting.com