JavaTM 2 Platform
Standard Ed. 6

java.io
类 WriteAbortedException

java.lang.Object
  继承者 java.lang.Throwable
      继承者 java.lang.Exception
          继承者 java.io.IOException
              继承者 java.io.ObjectStreamException
                  继承者 java.io.WriteAbortedException
所有已实现的接口:
Serializable

public class WriteAbortedException
extends ObjectStreamException

在写入操作过程中抛出 ObjectStreamException 之一的信号。在写入操作过程中抛出 ObjectStreamExceptions 之一时,在读取操作过程中将抛出此异常。终止写入的异常可在详细信息字段中找到。该流被重置为初始状态,而且对已经反序列化的对象的所有引用都被丢弃。

从版本 1.4 开始,已对此异常作出改进,以符合通用异常链机制。在构造时提供并通过公共 detail 字段访问的“导致中止的异常”现在称为 cause,并可通过 Throwable.getCause() 方法以及前述的“遗留字段”访问。

从以下版本开始:
JDK1.1
另请参见:
序列化表格

字段摘要
 Exception detail
          在写入 ObjectStream 时捕获的异常。
 
构造方法摘要
WriteAbortedException(String s, Exception ex)
          使用描述该异常的字符串和导致中止的异常构造一个 WriteAbortedException。
 
方法摘要
 Throwable getCause()
          返回终止操作的异常(即 cause)。
 String getMessage()
          生成此消息并包括嵌入异常的消息(如果有)。
 
从类 java.lang.Throwable 继承的方法
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

detail

public Exception detail
在写入 ObjectStream 时捕获的异常。

此字段早于通用异常链设施。Throwable.getCause() 方法现在是获得此信息的首选方法。

构造方法详细信息

WriteAbortedException

public WriteAbortedException(String s,
                             Exception ex)
使用描述该异常的字符串和导致中止的异常构造一个 WriteAbortedException。

参数:
s - 描述该异常的字符串。
ex - 导致中止的异常。
方法详细信息

getMessage

public String getMessage()
生成此消息并包括嵌入异常的消息(如果有)。

覆盖:
Throwable 中的 getMessage
返回:
Throwable 实例(可以为 null)的详细消息字符串。

getCause

public Throwable getCause()
返回终止操作的异常(即 cause)。

覆盖:
Throwable 中的 getCause
返回:
终止操作的异常(即 cause),可能为 null。
从以下版本开始:
1.4

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only