org.glassfish.grizzly.streams
Class StreamOutput

java.lang.Object
  extended by org.glassfish.grizzly.streams.StreamOutput
All Implemented Interfaces:
Output

public class StreamOutput
extends java.lang.Object
implements Output

Author:
oleksiys

Constructor Summary
StreamOutput(StreamWriter streamWriter)
           
 
Method Summary
 GrizzlyFuture<java.lang.Integer> close(CompletionHandler<java.lang.Integer> completionHandler)
          Close the StreamWriter and make sure all data was flushed.
 void ensureBufferCapacity(int size)
           
 GrizzlyFuture<java.lang.Integer> flush(CompletionHandler<java.lang.Integer> completionHandler)
          Make sure that all data that has been written is flushed from the stream to its destination.
 Buffer getBuffer()
          Return the Input's Buffer.
 boolean isBuffered()
           
 void write(Buffer buffer)
           
 void write(byte data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamOutput

public StreamOutput(StreamWriter streamWriter)
Method Detail

write

public void write(byte data)
           throws java.io.IOException
Specified by:
write in interface Output
Throws:
java.io.IOException

write

public void write(Buffer buffer)
           throws java.io.IOException
Specified by:
write in interface Output
Throws:
java.io.IOException

isBuffered

public boolean isBuffered()
Specified by:
isBuffered in interface Output

ensureBufferCapacity

public void ensureBufferCapacity(int size)
                          throws java.io.IOException
Specified by:
ensureBufferCapacity in interface Output
Throws:
java.io.IOException

getBuffer

public Buffer getBuffer()
Description copied from interface: Output
Return the Input's Buffer.

Specified by:
getBuffer in interface Output
Returns:
the Input's Buffer.

flush

public GrizzlyFuture<java.lang.Integer> flush(CompletionHandler<java.lang.Integer> completionHandler)
                                       throws java.io.IOException
Description copied from interface: Output
Make sure that all data that has been written is flushed from the stream to its destination.

Specified by:
flush in interface Output
Throws:
java.io.IOException

close

public GrizzlyFuture<java.lang.Integer> close(CompletionHandler<java.lang.Integer> completionHandler)
                                       throws java.io.IOException
Description copied from interface: Output
Close the StreamWriter and make sure all data was flushed.

Specified by:
close in interface Output
Throws:
java.io.IOException


Copyright © 2012 Oracle Corporation. All Rights Reserved.