poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Praveen Mathew" <prmat...@in.ibm.com>
Subject Re: HWPF: java doubts
Date Thu, 03 Jul 2003 10:44:14 GMT
Thanks Ryan, doubt cleared.. I have made the new FFn & fontable classes, 
just searching how to sent it as a patch.

Thanks & Regards

"Ryan Ackley" <sackley@cfl.rr.com>
03/07/2003 15:39
Please respond to "POI Developers List"

        To:     "POI Developers List" <poi-dev@jakarta.apache.org>
        Subject:        Re: HWPF: java doubts


> Thats cool!!
> Then why we need getUnsignedByte() itself??
> eg:  to read a byte read 0xff , get its unsigned value by typcasting to
> int  i,e 0x000000ff;
> & to write it back just write the byte  0xff.

The byte 0xff is equal to -1 so when you cast it to an int you end up with
an int that is equal to -1 (0xffffffff). We want an int that is equal to
255. When you cast from a smaller precision number to a larger precision
number (byte->int) the JVM will always preserve the sign.

To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message