InterruptedIOException (Java SE 15 & JDK 15) (original) (raw)
All Implemented Interfaces:
[Serializable](Serializable.html "interface in java.io")
Direct Known Subclasses:
[SocketTimeoutException](../net/SocketTimeoutException.html "class in java.net")
public class InterruptedIOException extends IOException
Signals that an I/O operation has been interrupted. AnInterruptedIOException
is thrown to indicate that an input or output transfer has been terminated because the thread performing it was interrupted. The field bytesTransferred indicates how many bytes were successfully transferred before the interruption occurred.
Since:
1.0
See Also:
InputStream, OutputStream, Thread.interrupt(), Serialized Form
Field Summary
Fields
Modifier and Type | Field | Description |
---|---|---|
int | bytesTransferred | Reports how many bytes had been transferred as part of the I/O operation before it was interrupted. |
Constructor Summary
Constructors
Constructor | Description |
---|---|
InterruptedIOException() | Constructs an InterruptedIOException withnull as its error detail message. |
InterruptedIOException​(String s) | Constructs an InterruptedIOException with the specified detail message. |
Method Summary
Methods declared in class java.lang.Throwable
[addSuppressed](../lang/Throwable.html#addSuppressed%28java.lang.Throwable%29), [fillInStackTrace](../lang/Throwable.html#fillInStackTrace%28%29), [getCause](../lang/Throwable.html#getCause%28%29), [getLocalizedMessage](../lang/Throwable.html#getLocalizedMessage%28%29), [getMessage](../lang/Throwable.html#getMessage%28%29), [getStackTrace](../lang/Throwable.html#getStackTrace%28%29), [getSuppressed](../lang/Throwable.html#getSuppressed%28%29), [initCause](../lang/Throwable.html#initCause%28java.lang.Throwable%29), [printStackTrace](../lang/Throwable.html#printStackTrace%28%29), [printStackTrace](../lang/Throwable.html#printStackTrace%28java.io.PrintStream%29), [printStackTrace](../lang/Throwable.html#printStackTrace%28java.io.PrintWriter%29), [setStackTrace](../lang/Throwable.html#setStackTrace%28java.lang.StackTraceElement%5B%5D%29), [toString](../lang/Throwable.html#toString%28%29)
Field Details
bytesTransferred
public int bytesTransferred
Reports how many bytes had been transferred as part of the I/O operation before it was interrupted.Constructor Details
InterruptedIOException
public InterruptedIOException()
Constructs anInterruptedIOException
withnull
as its error detail message.InterruptedIOException
public InterruptedIOException​(String s)
Constructs anInterruptedIOException
with the specified detail message. The strings
can be retrieved later by the[Throwable.getMessage()](../lang/Throwable.html#getMessage%28%29)
method of classjava.lang.Throwable
.
Parameters:
s
- the detail message.