public abstract class AsyncOutputStream extends Object
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 and Description |
|---|
AsyncOutputStream() |
| Modifier and Type | Method and Description |
|---|---|
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
|
public abstract BufferMonitor createMonitor(long position, MonitorListener flushListener)
position - position to triggerflushListener - alarm listenerpublic abstract long getFlushPosition()
public abstract long getPosition()
public abstract long getUnflushedBytes()
public abstract void offer(ByteBuffer buf)
buf - buffer to offerpublic abstract void write(ByteBuffer src)
src - a ByteBuffer object.public abstract void write(ByteBuffer src, int length)
src - a ByteBuffer object.length - a int.Copyright © 2026. All rights reserved.