home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / OptionalDataException.java < prev    next >
Text File  |  1997-05-20  |  2KB  |  67 lines

  1. /*
  2.  * %W% %E%
  3.  * 
  4.  * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  */
  21. package java.io;
  22.  
  23. /**
  24.  * Unexpected data appeared in an ObjectInputStream trying to read
  25.  * an Object.
  26.  * This exception occurs when the stream contains primitive data
  27.  * instead of the object expected by readObject.
  28.  * The eof flag in the exception is true to indicate that no more
  29.  * primitive data is available.
  30.  * The count field contains the number of bytes available to read.
  31.  *
  32.  * @author  unascribed
  33.  * @version %I%, %G%
  34.  * @since   JDK1.1
  35.  */
  36. public class OptionalDataException extends ObjectStreamException {
  37.     /*
  38.      * Create an <code>OptionalDataException</code> with a length.
  39.      */
  40.     OptionalDataException(int len) {
  41.     eof = false;
  42.     length = len;
  43.     }
  44.  
  45.     /*
  46.      * Create an <code>OptionalDataException</code> signifing no
  47.      * more primitive data is available.
  48.      */    
  49.     OptionalDataException(boolean end) {
  50.     length = 0;
  51.     eof = end;
  52.     }
  53.     
  54.     /**
  55.      * The number of bytes of primitive data available to be read
  56.      * in the current buffer.
  57.      * @since   JDK1.1
  58.      */
  59.     public int length;
  60.  
  61.     /**
  62.      * True if there is no more data in the buffered part of the stream.
  63.      * @since   JDK1.1
  64.      */
  65.     public boolean eof;
  66. }
  67.