dev@fi.java.net

Re: C.25 again

From: Arman Djusupov <arman_at_noemax.com>
Date: Tue, 12 Jan 2010 12:04:20 +0200

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
>
>
>