net.sf.asyncobjects.net.nio
Class NIOSocketOutputStream

java.lang.Object
  extended by net.sf.asyncobjects.AsyncUnicastServer<T>
      extended by net.sf.asyncobjects.net.nio.NIOStream<AByteOutput>
          extended by net.sf.asyncobjects.net.nio.NIOSocketOutputStream
All Implemented Interfaces:
ACloseable, AsyncObject, ExplicitSharing, AByteOutput, AOutput<BinaryData>

public class NIOSocketOutputStream
extends NIOStream<AByteOutput>
implements AByteOutput

Output stream based on SocketChannel.

Author:
const

Field Summary
 
Fields inherited from class net.sf.asyncobjects.net.nio.NIOStream
isClosed
 
Method Summary
 Promise<Void> flush()
          Flush stream.
protected  void shutdownStream()
          Shutdown stream
 Promise<Void> write(BinaryData data)
          Write data
 
Methods inherited from class net.sf.asyncobjects.net.nio.NIOStream
awake, close, ensureOpen, getDirectBuffer, returnDirectBuffer
 
Methods inherited from class net.sf.asyncobjects.AsyncUnicastServer
dereference, export, isImmediate, myVat, promise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.asyncobjects.ACloseable
close
 
Methods inherited from interface net.sf.asyncobjects.AsyncObject
dereference, isImmediate
 

Method Detail

write

public Promise<Void> write(BinaryData data)
Write data

Specified by:
write in interface AOutput<BinaryData>
Parameters:
data - a data to wriate.
Returns:
Promise for null.
See Also:
AOutput.write(net.sf.asyncobjects.io.BatchedData)

flush

public Promise<Void> flush()
Flush stream. This particular version just does nothing.

Specified by:
flush in interface AOutput<BinaryData>
Returns:
a promise that resolves to null or breaks with exception.
See Also:
AOutput.flush()

shutdownStream

protected void shutdownStream()
                       throws IOException
Description copied from class: NIOStream
Shutdown stream

Specified by:
shutdownStream in class NIOStream<AByteOutput>
Throws:
IOException - if there is a problem with shutdowing
See Also:
NIOStream.shutdownStream()


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.