1. /*
  2. * @(#)OptionalDataException.java 1.19 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * Licensed Materials - Property of IBM
  9. * RMI-IIOP v1.0
  10. * Copyright IBM Corp. 1998 1999 All Rights Reserved
  11. *
  12. * US Government Users Restricted Rights - Use, duplication or
  13. * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  14. */
  15. package com.sun.corba.se.internal.io;
  16. /**
  17. * Unexpected data appeared in an ObjectInputStream trying to read
  18. * an Object.
  19. * This exception occurs when the stream contains primitive data
  20. * instead of the object expected by readObject.
  21. * The eof flag in the exception is true to indicate 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 1.7, 11/02/98
  27. * @since JDK1.1
  28. */
  29. public class OptionalDataException extends java.io.IOException {
  30. /*
  31. * Create an <code>OptionalDataException</code> with a length.
  32. */
  33. OptionalDataException(int len) {
  34. eof = false;
  35. length = len;
  36. }
  37. /*
  38. * Create an <code>OptionalDataException</code> signifing no
  39. * more primitive data is available.
  40. */
  41. OptionalDataException(boolean end) {
  42. length = 0;
  43. eof = end;
  44. }
  45. /**
  46. * The number of bytes of primitive data available to be read
  47. * in the current buffer.
  48. */
  49. public int length;
  50. /**
  51. * True if there is no more data in the buffered part of the stream.
  52. */
  53. public boolean eof;
  54. }