KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > io > ObjectOutput


1 /*
2  * @(#)ObjectOutput.java 1.16 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 package java.io;
9
10 /**
11  * ObjectOutput extends the DataOutput interface to include writing of objects.
12  * DataOutput includes methods for output of primitive types, ObjectOutput
13  * extends that interface to include objects, arrays, and Strings.
14  *
15  * @author unascribed
16  * @version 1.16, 12/19/03
17  * @see java.io.InputStream
18  * @see java.io.ObjectOutputStream
19  * @see java.io.ObjectInputStream
20  * @since JDK1.1
21  */

22 public interface ObjectOutput extends DataOutput JavaDoc {
23     /**
24      * Write an object to the underlying storage or stream. The
25      * class that implements this interface defines how the object is
26      * written.
27      *
28      * @param obj the object to be written
29      * @exception IOException Any of the usual Input/Output related exceptions.
30      */

31     public void writeObject(Object JavaDoc obj)
32       throws IOException JavaDoc;
33
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 JavaDoc;
41
42     /**
43      * Writes an array of bytes. This method will block until the bytes
44      * are actually written.
45      * @param b the data to be written
46      * @exception IOException If an I/O error has occurred.
47      */

48     public void write(byte b[]) throws IOException JavaDoc;
49
50     /**
51      * Writes a sub array of bytes.
52      * @param b the data to be written
53      * @param off the start offset in the data
54      * @param len the number of bytes that are written
55      * @exception IOException If an I/O error has occurred.
56      */

57     public void write(byte b[], int off, int len) throws IOException JavaDoc;
58
59     /**
60      * Flushes the stream. This will write any buffered
61      * output bytes.
62      * @exception IOException If an I/O error has occurred.
63      */

64     public void flush() throws IOException JavaDoc;
65
66     /**
67      * Closes the stream. This method must be called
68      * to release any resources associated with the
69      * stream.
70      * @exception IOException If an I/O error has occurred.
71      */

72     public void close() throws IOException JavaDoc;
73 }
74
Popular Tags