package j3deditor.bin.hierarchy.util;

import java.io.InputStream;
import java.io.OutputStream;


/**
 * Identifies the instance of implementing class
 * as serializable hierarchy object and allows its state
 * to be serialized or deserialized.
 *
 * @author Risto Seene
 */
public interface J3DeSerializable{

	/**
	 * Writes the state to output stream.
	 * 
	 * @param out
	 * 	stream the data will be written to
	 * @throws Exception
	 * 	if unable to write
	 */
	public void writeData(OutputStream out) throws Exception;

	/**
	 * Reads the state from input stream.
	 * 
	 * @param in
	 * 	stream the data will be read from
	 * @throws Exception
	 * 	if unable to read
	 */
	public void readData(InputStream in) throws Exception;

}
