All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bridge.IInputConnection Maven / Gradle / Ivy

Go to download

Jadex bridge is a base package for kernels and platforms, i.e., it is used by both and provides commonly used interfaces and classes for active components and their management.

There is a newer version: 4.0.267
Show newest version
package jadex.bridge;

import java.io.OutputStream;

import jadex.commons.future.ISubscriptionIntermediateFuture;


/**
 *  Interface for input connection stream.
 */
public interface IInputConnection extends IConnection
{
	/**
	 *  Non-blocking read. Tries to read the next byte.
	 *  @return The next byte or -1 if the end of the stream has been reached.
	 */
	public int read();
	
	/**
	 *  Non-blocking read. Tries to fill the 
	 *  buffer from the stream.
	 *  @param buffer The buffer to read in.
	 *  @return The number of bytes that could be read
	 *  into the buffer.
	 */
	public int read(byte[] buffer);
	
	/**
	 *  Asynchronous read. 
	 *  @return Bytes one by one till end of stream or closed.
	 */
//	public IIntermediateFuture aread();
	public ISubscriptionIntermediateFuture aread();
	
	/**
	 *  Get the number of available bytes.
	 *  @return The number of available bytes. 
	 */
	public int available();
	
//	/**
//	 *  Asynchronous read. 
//	 *  @return Bytes one by one till end of stream or closed.
//	 */
//	public IFuture areadNext();
	
//	/**
//	 *  Blocking read. Read the next byte.
//	 *  @return The next byte or -1 if the end of the stream has been reached.
//	 */
//	public int bread();
	
	/**
	 *  Write all data from the connection to the output stream.
	 *  The result is an intermediate future that reports back the size that was read.
	 *  It can also be used to terminate reading.
	 *  @param is The input stream.
	 *  @param component The component.
	 */
	public ISubscriptionIntermediateFuture writeToOutputStream(final OutputStream os, final IExternalAccess component);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy