鸿蒙OS开发文档 鸿蒙OS InterruptedIOException

2024-02-25 开发教程 鸿蒙OS开发文档 匿名 4

InterruptedIOException

java.lang.Object
|---java.lang.Throwable
|---|---java.lang.Exception
|---|---|---java.io.IOException
|---|---|---|---java.io.InterruptedIOException

public class InterruptedIOException
extends IOException

表示 I/O 操作已被中断。 抛出 InterruptedIOException 以指示输入或输出传输已终止,因为执行它的线程被中断。 字段 bytesTransferred 指示在中断发生之前成功传输了多少字节。

Since:

JDK1.0

字段摘要

修饰符和类型字段描述
intbytesTransferred报告在中断之前作为 I/O 操作的一部分传输了多少字节。

构造函数摘要

构造函数描述
InterruptedIOException()构造一个带有 null 作为其错误详细消息的 InterruptedIOException。
InterruptedIOException(String s)构造带有指定详细消息的 InterruptedIOException。

方法总结

从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从类 java.lang.Throwable 继承的方法
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

字段详细信息

bytesTransferred

public int bytesTransferred

报告在中断之前作为 I/O 操作的一部分传输了多少字节。

构造函数详细信息

InterruptedIOException

public InterruptedIOException()

构造一个带有 null 作为其错误详细消息的 InterruptedIOException。

InterruptedIOException

public InterruptedIOException(String s)

构造带有指定详细消息的 InterruptedIOException。 字符串 s 可以稍后通过 java.lang.Throwable 类的 Throwable.getMessage() 方法检索。

参数:

参数名称参数描述
s详细信息。