public class WriteAbortedException
extends ObjectStreamException
| java.lang.Object | |||||
| java.lang.Throwable | |||||
| java.lang.Exception | |||||
| java.io.IOException | |||||
| java.io.ObjectStreamException | |||||
| java.io.WriteAbortedException | |||||
表示在写入操作期间抛出了ObjectStreamExceptions之一。 在写入操作期间抛出其中一个ObjectStreamException时,在读取操作期间抛出。 可以在详细字段中找到终止写入的异常。 流被重置为初始状态,并且所有对已经反序列化的对象的引用都被丢弃。
从版本1.4开始,此异常已进行了改进,以符合通用异常链接机制。 在施工时提供并通过公众detail字段访问的“造成中止的异常”现在被称为原因 ,并且可以通过getCause()方法以及上述“遗留字段”来访问。
Fields |
|
|---|---|
public 异常 |
detail 在编写ObjectStream时被捕获的异常。 |
Public constructors |
|
|---|---|
WriteAbortedException(String s, 异常 ex) 用描述异常的字符串和导致中止的异常构造WriteAbortedException。 |
|
公共方法(Public methods) |
|
|---|---|
Throwable |
getCause() 返回终止操作的异常( 原因 )。 |
String |
getMessage() 生成消息并包含来自嵌套异常的消息(如果有的话)。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Throwable
|
|
java.lang.Object
|
|
异常 detail
在编写ObjectStream时被捕获的异常。
该字段早于通用异常链接设施。 getCause()方法现在是获取此信息的首选方法。
WriteAbortedException (String s, 异常 ex)
用描述异常的字符串和导致中止的异常构造WriteAbortedException。
| 参数(Parameters) | |
|---|---|
s |
String: String describing the exception. |
ex |
异常: Exception causing the abort. |
Throwable getCause ()
返回终止操作的异常( 原因 )。
| 返回(Returns) | |
|---|---|
Throwable |
the exception that terminated the operation (the cause), which may be null. |
String getMessage ()
生成消息并包含来自嵌套异常的消息(如果有的话)。
| 返回(Returns) | |
|---|---|
String |
the detail message string of this Throwable instance (which may be null). |