|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
org.opcfoundation.ua.utils.asyncsocket.AsyncOutputStream
public abstract class AsyncOutputStream
Asyncronous output stream of asynchronous socket. There are two positions properties: Bytes written and bytes flushed.
Flushing of data can be monitored asyncronously with Alarm object. e.g. byte[] data; long pos = os.getPosition(); os.write(data); Alarm a = os.createAlarm(pos + data.length, flushListener);
BufferMonitor,
AsyncSocketImpl| Constructor Summary | |
|---|---|
AsyncOutputStream()
|
|
| Method Summary | |
|---|---|
abstract BufferMonitor |
createMonitor(long position,
MonitorListener flushListener)
Create an object that monitors for flush position of the output stream. |
abstract long |
getFlushPosition()
Get the position of stream that has been flushed. |
abstract long |
getPosition()
Get the position of the stream |
abstract long |
getUnflushedBytes()
Get number of bytes remaining to be written |
abstract void |
offer(ByteBuffer buf)
Offers byte buffer to the output stream for write. |
abstract void |
write(ByteBuffer src)
Write to stream |
abstract void |
write(ByteBuffer src,
int length)
Write to stream |
| Methods inherited from class java.io.OutputStream |
|---|
close, flush, write, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsyncOutputStream()
| Method Detail |
|---|
public abstract void write(ByteBuffer src)
src - a ByteBuffer object.
public abstract void write(ByteBuffer src,
int length)
src - a ByteBuffer object.length - a int.public abstract void offer(ByteBuffer buf)
buf - buffer to offerpublic abstract long getFlushPosition()
public abstract long getPosition()
public abstract long getUnflushedBytes()
public abstract BufferMonitor createMonitor(long position,
MonitorListener flushListener)
position - position to triggerflushListener - alarm listener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||