KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > io > OptionalDataException


1 /*
2  * @(#)OptionalDataException.java 1.21 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 /*
9  * Licensed Materials - Property of IBM
10  * RMI-IIOP v1.0
11  * Copyright IBM Corp. 1998 1999 All Rights Reserved
12  *
13  * US Government Users Restricted Rights - Use, duplication or
14  * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
15  */

16
17 package com.sun.corba.se.impl.io;
18
19 /**
20  * Unexpected data appeared in an ObjectInputStream trying to read
21  * an Object.
22  * This exception occurs when the stream contains primitive data
23  * instead of the object expected by readObject.
24  * The eof flag in the exception is true to indicate that no more
25  * primitive data is available.
26  * The count field contains the number of bytes available to read.
27  *
28  * @author unascribed
29  * @version 1.7, 11/02/98
30  * @since JDK1.1
31  */

32 public class OptionalDataException extends java.io.IOException JavaDoc {
33     /*
34      * Create an <code>OptionalDataException</code> with a length.
35      */

36     OptionalDataException(int len) {
37     eof = false;
38     length = len;
39     }
40
41     /*
42      * Create an <code>OptionalDataException</code> signifing no
43      * more primitive data is available.
44      */

45     OptionalDataException(boolean end) {
46     length = 0;
47     eof = end;
48     }
49
50     /**
51      * The number of bytes of primitive data available to be read
52      * in the current buffer.
53      */

54     public int length;
55
56     /**
57      * True if there is no more data in the buffered part of the stream.
58      */

59     public boolean eof;
60 }
61
Popular Tags