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
bytes & integers in streams
Posted by Ivan Villanueva on June 20, 2001 at 11:41 AM
In the java 1.3 I/O Systems,
I understand that the old methods write bytes (8 bits) and the new one (with Readers & Writers) write uni-code (16 bits, like characters in java). In the java documentation you can read for the old class FileOutputStream:
public void write(int b)
Writes the specified byte to this file output stream. Implements the write method of OutputStream.
But integers are 32 bit !!!
Can anybody get me out of this confusion ? I cannot understand how it cans write something that is 32bit in the place of a byte that is 8bit.
thanks a lot