Package com.parctechnologies.eclipse
Class FromEclipseQueue
java.lang.Object
java.io.InputStream
com.parctechnologies.eclipse.FromEclipseQueue
- All Implemented Interfaces:
Closeable,AutoCloseable
A queue for
sending data from ECLiPSe to Java. This class performs no processing of the
data and cannot for example, deal with EXDR format (see
EXDRInputStream
for a class which can handle this).
In addition to the standard methods inherited from its superclass, this class
also provides the ability to attach a QueueListener object to the
FromEclipseQueue, as a handler for incoming data.
There is no public constructor; to access an FromEclipseQueue use the
createFromEclipseQueue() of an object implementing the EclipseConnection interface or the getEclipseStderr() or
getEclipseStdout() method of an object implementing the
EclipseEngine interface.
-
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()Closes the queue (both eclipse and Java sides), removing any listener.intread()intread(byte[] b, int off, int len) Read bytes from the FromEclipseQueue into a byte array.voidDetach any QueueListener from this FromEclipseQueue.voidAttach a QueueListener to this FromEclipseQueue for handling incoming data.Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
read
Read bytes from the FromEclipseQueue into a byte array.lenbytes are read from the queue and stored in byte arraybat offsetoff.- Overrides:
readin classInputStream- Returns:
- the number of bytes read.
- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
setListener
Attach a QueueListener to this FromEclipseQueue for handling incoming data. When ECLiPSe flushes the queue, thedataAvailable()method of the QueueListener is invoked.- Throws:
IOException
-
removeListener
Detach any QueueListener from this FromEclipseQueue.- Throws:
IOException
-
close
Closes the queue (both eclipse and Java sides), removing any listener.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-