KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > nutch > io > Writable


1 /* Copyright (c) 2003 The Nutch Organization. All rights reserved. */
2 /* Use subject to the conditions in http://www.nutch.org/LICENSE.txt. */
3
4 package net.nutch.io;
5
6 import java.io.DataOutput JavaDoc;
7 import java.io.DataInput JavaDoc;
8 import java.io.IOException JavaDoc;
9
10 /** A simple, efficient, serialization protocol, based on {@link DataInput} and
11  * {@link DataOutput}.
12  *
13  * <p>Implementations typically implement a static <code>read(DataInput)</code>
14  * method which constructs a new instance, calls {@link
15  * #readFields(DataInput)}, and returns the instance.
16  *
17  * @author Doug Cutting
18  */

19 public interface Writable {
20   /** Writes the fields of this object to <code>out</code>. */
21   void write(DataOutput JavaDoc out) throws IOException JavaDoc;
22
23   /** Reads the fields of this object from <code>in</code>. For efficiency,
24    * implementations should attempt to re-use storage in the existing object
25    * where possible.
26    */

27   void readFields(DataInput JavaDoc in) throws IOException JavaDoc;
28 }
29
Popular Tags