package cdac.medinfo.sdk.hl7282.hl7net.commons;

import java.io.IOException;

/**
 * The INetworkAgent interface should be implemented by any class whose instances are intended to read and write purpose.
 */
public interface INetworkAgent 
{
	/**
	 * Reads Data From Input Stream of Underlying Socket with Packet Size of 1MB.
	 * @throws InterruptedException 
	 * @throws IOException  Signals that an IO Exception has occurred.
	 */
	public void read() throws InterruptedException, IOException ;
	
	/**
	 * Writes data on Output Stream of Underlying Socket.
	 * @param buffer the buffer to be written
	 * @throws IOException  Signals that an IO Exception has occurred.
	 */
	public void write(byte[] buffer) throws IOException;
	
	/**
	 * Sets ConnectionListener.
	 * @param IConnectionListener
	 */
	public void setConnectionListener(IConnectionListener objIConnectionListener);
}
