< prev index next >

src/java.base/share/classes/java/io/WriteAbortedException.java

Print this page




  27 
  28 /**
  29  * Signals that one of the ObjectStreamExceptions was thrown during a
  30  * write operation.  Thrown during a read operation when one of the
  31  * ObjectStreamExceptions was thrown during a write operation.  The
  32  * exception that terminated the write can be found in the detail
  33  * field. The stream is reset to it's initial state and all references
  34  * to objects already deserialized are discarded.
  35  *
  36  * <p>As of release 1.4, this exception has been retrofitted to conform to
  37  * the general purpose exception-chaining mechanism.  The "exception causing
  38  * the abort" that is provided at construction time and
  39  * accessed via the public {@link #detail} field is now known as the
  40  * <i>cause</i>, and may be accessed via the {@link Throwable#getCause()}
  41  * method, as well as the aforementioned "legacy field."
  42  *
  43  * @author  unascribed
  44  * @since   1.1
  45  */
  46 public class WriteAbortedException extends ObjectStreamException {

  47     private static final long serialVersionUID = -3326426625597282442L;
  48 
  49     /**
  50      * Exception that was caught while writing the ObjectStream.
  51      *
  52      * <p>This field predates the general-purpose exception chaining facility.
  53      * The {@link Throwable#getCause()} method is now the preferred means of
  54      * obtaining this information.
  55      *
  56      * @serial
  57      */
  58     public Exception detail;
  59 
  60     /**
  61      * Constructs a WriteAbortedException with a string describing
  62      * the exception and the exception causing the abort.
  63      * @param s   String describing the exception.
  64      * @param ex  Exception causing the abort.
  65      */
  66     public WriteAbortedException(String s, Exception ex) {




  27 
  28 /**
  29  * Signals that one of the ObjectStreamExceptions was thrown during a
  30  * write operation.  Thrown during a read operation when one of the
  31  * ObjectStreamExceptions was thrown during a write operation.  The
  32  * exception that terminated the write can be found in the detail
  33  * field. The stream is reset to it's initial state and all references
  34  * to objects already deserialized are discarded.
  35  *
  36  * <p>As of release 1.4, this exception has been retrofitted to conform to
  37  * the general purpose exception-chaining mechanism.  The "exception causing
  38  * the abort" that is provided at construction time and
  39  * accessed via the public {@link #detail} field is now known as the
  40  * <i>cause</i>, and may be accessed via the {@link Throwable#getCause()}
  41  * method, as well as the aforementioned "legacy field."
  42  *
  43  * @author  unascribed
  44  * @since   1.1
  45  */
  46 public class WriteAbortedException extends ObjectStreamException {
  47     @java.io.Serial
  48     private static final long serialVersionUID = -3326426625597282442L;
  49 
  50     /**
  51      * Exception that was caught while writing the ObjectStream.
  52      *
  53      * <p>This field predates the general-purpose exception chaining facility.
  54      * The {@link Throwable#getCause()} method is now the preferred means of
  55      * obtaining this information.
  56      *
  57      * @serial
  58      */
  59     public Exception detail;
  60 
  61     /**
  62      * Constructs a WriteAbortedException with a string describing
  63      * the exception and the exception causing the abort.
  64      * @param s   String describing the exception.
  65      * @param ex  Exception causing the abort.
  66      */
  67     public WriteAbortedException(String s, Exception ex) {


< prev index next >