Why Java OutputStream.write() Takes Integer but Writes Bytes

So you can signal EOF:

“Notice that read() returns an int value. If the input is a stream of bytes, why doesn’t read() return a byte value? Using a int as a return type allows read() to use -1 to indicate that it has reached the end of the stream.”

http://java.sun.com/docs/books/tutorial/essential/io/bytestreams.html

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)