01: package org.jgroups.util;
02:
03: import java.io.DataInputStream;
04: import java.io.DataOutputStream;
05: import java.io.IOException;
06:
07: /**
08: * Implementations of Streamable can add their state directly to the output stream, enabling them to bypass costly
09: * serialization
10: * @author Bela Ban
11: * @version $Id: Streamable.java,v 1.2 2005/07/25 16:21:47 belaban Exp $
12: */
13: public interface Streamable {
14:
15: /** Write the entire state of the current object (including superclasses) to outstream.
16: * Note that the output stream <em>must not</em> be closed */
17: void writeTo(DataOutputStream out) throws IOException;
18:
19: /** Read the state of the current object (including superclasses) from instream
20: * Note that the input stream <em>must not</em> be closed */
21: void readFrom(DataInputStream in) throws IOException,
22: IllegalAccessException, InstantiationException;
23: }
|