Lets checkout the options below
a A character of more than 8 bits was read from the stream.
// a programs should use the byte streams, descendants of InputStream and OutputStream, to read and write 8-bit bytes. Now since an InputStream was passed as parameter the program can read only 8 bit bytes as such this is wrong. Remember character streams (Reader and Writer) cannot be passed as parameters to methods that take InputStreams so this is false.
b An I/O error occurred.
// The read() method is declared as
public abstract int read()throws IOException.
Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. A subclass must provide an implementation of this method.
Returns : the next byte of data, or -1 if the end of the stream is reached.
Throws : IOException - if an I/O error occurs.
If an I/O exception occurs then the next statements ie (return value == (value & 0xFF)
are not executed and the method returns terminating the program or exiting that particular block if the exception is handled. uncomment the lines in the program below and check out the results. this too does not return false.
c Never
// if all options are wrong maybe this one is correct
d The end of the input was reached in the input stream.
// correct. dandan and Vansrini have given appropriate answers for this. However check out the program below.
Regds.
Rahul.
[This message has been edited by Rahul Mahindrakar (edited August 04, 2000).]