InterruptedIOException

Some methods of various I/O classes will throw an InterruptedIOException in response to the interrupt() method: if the target thread was blocked on an I/O operation, then the InterruptedIOException will be thrown. On green-thread implementations, this is implemented incompletely: some I/O methods are interruptible and some are not. This feature is not implemented at all on Windows. On Solaris native-thread virtual machines, this is implemented somewhat inconsistently: in Java 1.1, some operations will throw a standard exception (e.g., SocketException), and in Java 2 they will throw an InterruptedIOException.

In the future, this implementation will be consistent, but it is unclear what direction that will take, and it’s possible that this exception will be deprecated. In the meantime, developers who need to interrupt I/O should close the stream on which the I/O is being performed, and interrupted I/O should not be considered restartable, even on platforms that support it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset