I am working with a DataInputStream and had a question about EOFExceptions.
According to java docs:
Signals that an end of file or end of
stream has been reached unexpectedly
during input.
This exception is mainly used by data
input streams to signal end of stream.
Note that many other input operations
return a special value on end of
stream rather than throwing an
exception.
Does this mean that when a EOFException is generated, the stream will not NEVER open again? Does it mean you should NEVER expect any more data from it ever?
If an outputstream is connected to an inputstream and outputstream.close() is called, will an inputstream receive the EOFException or an IOException?
An IOException is described as:
Signals that an I/O exception of some
sort has occurred. This class is the
general class of exceptions produced
by failed or interrupted I/O
operations.
Does a close on the outputstream produce either a EOFException or an IOException on the datainputstream side?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…