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
Praveen
"Ryan Ackley" <[EMAIL PROTECTED]>
03/07/2003 07:17
Please respond to "POI Developers List"
To: "POI Developers List" <[EMAIL PROTECTED]>
cc:
Subject: Re: HWPF: java doubts
> So now either we may have to typeCast byte to int to get its actual
value
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]