home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / io / OptionalDataException.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  1.6 KB  |  62 lines  |  [TEXT/CWIE]

  1. /*
  2.  * %W% %E%
  3.  *
  4.  * Copyright 1996-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14. package java.io;
  15.  
  16. /**
  17.  * Unexpected data appeared in an ObjectInputStream trying to read
  18.  * an Object.
  19.  * Occurs when the stream contains primitive data
  20.  * instead of the object that is expected by readObject.
  21.  * The EOF flag in the exception is true indicating that no more
  22.  * primitive data is available.
  23.  * The count field contains the number of bytes available to read.
  24.  *
  25.  * @author  unascribed
  26.  * @version %I%, %G%
  27.  * @since   JDK1.1
  28.  */
  29. public class OptionalDataException extends ObjectStreamException {
  30.     /*
  31.      * Create an <code>OptionalDataException</code> with a length.
  32.      */
  33.     OptionalDataException(int len) {
  34.     eof = false;
  35.     length = len;
  36.     }
  37.  
  38.     /*
  39.      * Create an <code>OptionalDataException</code> signifing no
  40.      * more primitive data is available.
  41.      */
  42.     OptionalDataException(boolean end) {
  43.     length = 0;
  44.     eof = end;
  45.     }
  46.  
  47.     /**
  48.      * The number of bytes of primitive data available to be read
  49.      * in the current buffer.
  50.      *
  51.      * @serial
  52.      */
  53.     public int length;
  54.  
  55.     /**
  56.      * True if there is no more data in the buffered part of the stream.
  57.      *
  58.      * @serial
  59.      */
  60.     public boolean eof;
  61. }
  62.