I am writing an OutputStream, just noticed this in the OutputStream interface,
public abstract void write(int b) throws IOException;
Thi
Maybe it's because bytes are signed by default, and files store bytes as unsigned values. That is why read() returns an int - to give 255 instead of -1 for $FF. Same with write(int), you can not store $FF as 255 in a byte.
read()
write(int)