1. /*
  2. * @(#)ObjectOutput.java 1.13 00/02/02
  3. *
  4. * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.io;
  11. /**
  12. * ObjectOutput extends the DataOutput interface to include writing of objects.
  13. * DataOutput includes methods for output of primitive types, ObjectOutput
  14. * extends that interface to include objects, arrays, and Strings.
  15. *
  16. * @author unascribed
  17. * @version 1.13, 02/02/00
  18. * @see java.io.InputStream
  19. * @see java.io.ObjectOutputStream
  20. * @see java.io.ObjectInputStream
  21. * @since JDK1.1
  22. */
  23. public interface ObjectOutput extends DataOutput {
  24. /**
  25. * Write an object to the underlying storage or stream. The
  26. * class that implements this interface defines how the object is
  27. * written.
  28. *
  29. * @param obj the object to be written
  30. * @exception IOException Any of the usual Input/Output related exceptions.
  31. */
  32. public void writeObject(Object obj)
  33. throws IOException;
  34. /**
  35. * Writes a byte. This method will block until the byte is actually
  36. * written.
  37. * @param b the byte
  38. * @exception IOException If an I/O error has occurred.
  39. */
  40. public void write(int b) throws IOException;
  41. /**
  42. * Writes an array of bytes. This method will block until the bytes
  43. * are actually written.
  44. * @param b the data to be written
  45. * @exception IOException If an I/O error has occurred.
  46. */
  47. public void write(byte b[]) throws IOException;
  48. /**
  49. * Writes a sub array of bytes.
  50. * @param b the data to be written
  51. * @param off the start offset in the data
  52. * @param len the number of bytes that are written
  53. * @exception IOException If an I/O error has occurred.
  54. */
  55. public void write(byte b[], int off, int len) throws IOException;
  56. /**
  57. * Flushes the stream. This will write any buffered
  58. * output bytes.
  59. * @exception IOException If an I/O error has occurred.
  60. */
  61. public void flush() throws IOException;
  62. /**
  63. * Closes the stream. This method must be called
  64. * to release any resources associated with the
  65. * stream.
  66. * @exception IOException If an I/O error has occurred.
  67. */
  68. public void close() throws IOException;
  69. }