The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

RE byte, integer

Posted by Pierre on June 21, 2001 at 3:32 AM

> public void write(int b)
> throws IOException
> Writes the specified byte to this file output stream. Implements the write method of OutputStream.
>
> But integers are 32 bit !!!
if you look at the doc of OutputStream.write(int b) :

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us