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 06:18:38 GMT
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.

what about the HWPFOutputStream. write() which takes only a byte array????

Thanks & Regards

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

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


> So now either we may have to typeCast byte to int to get its actual 
> or use int for storing value & take only the LSB for actual byte.
> Then I guess we need a function called putUnsignedByte( ) in
> LittleEndian.java

No, because consider the following example:

I read the byte 0xff from a stream. The signed value is -1 the unsigned
value is 255. I use LittleEndian.getUnsignedByte() to read it in as an int
with the following hex value 0x000000ff. All we have to do is cast it to a
byte ((byte)0x000000ff) to get back to 0xff.

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