Possible Duplicate:
Why does InputStream#read() return an int and not a byte?Issue regarding the return value of the read() function in java?
As per the documentation the read() method of java.io.FileInputStream class reads next byte of the input stream, then why it’s return type is integer, why not byte.
Is there any issue behind this?
from the manual:
you can’t store
-1in a byte, otherwise it would be indistinguishable from a valid read, so that’s the reason.