that clears things up for read() in FileInputStream. Another question, in the DataInputStream.readInt() method why can't the return value of -1 be used to indicate the end of file, why does the EOFException needs to be thrown.
why would -1 be a valid value for DataInputStream.readInt() and not for the FileInputStream.read() ( you have explained that though )
Thanks again for your help.
V
The ReadInt method "Returns: the next four bytes of this input stream, interpreted as an int."
It assumes that the 4 bytes are a valid int (they will be if you're doing things correctly), and an int can have a value of -1, so it can't use that value as EOF.
If you learn how signed/negative numbers are represented at the bit-level, this will make sense to you. Do a search for "two's complement arithmetic", which is how it's done.