Package org.glassfish.grizzly.streams
Class StreamOutput
- java.lang.Object
-
- org.glassfish.grizzly.streams.StreamOutput
-
-
Constructor Summary
Constructors Constructor Description StreamOutput(StreamWriter streamWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrizzlyFuture<Integer>
close(CompletionHandler<Integer> completionHandler)
Close theStreamWriter
and make sure all data was flushed.void
ensureBufferCapacity(int size)
GrizzlyFuture<Integer>
flush(CompletionHandler<Integer> completionHandler)
Make sure that all data that has been written is flushed from the stream to its destination.Buffer
getBuffer()
Return the Input'sBuffer
.boolean
isBuffered()
void
write(byte data)
void
write(Buffer buffer)
-
-
-
Constructor Detail
-
StreamOutput
public StreamOutput(StreamWriter streamWriter)
-
-
Method Detail
-
write
public void write(byte data) throws IOException
- Specified by:
write
in interfaceOutput
- Throws:
IOException
-
write
public void write(Buffer buffer) throws IOException
- Specified by:
write
in interfaceOutput
- Throws:
IOException
-
isBuffered
public boolean isBuffered()
- Specified by:
isBuffered
in interfaceOutput
-
ensureBufferCapacity
public void ensureBufferCapacity(int size) throws IOException
- Specified by:
ensureBufferCapacity
in interfaceOutput
- Throws:
IOException
-
getBuffer
public Buffer getBuffer()
Description copied from interface:Output
Return the Input'sBuffer
.
-
flush
public GrizzlyFuture<Integer> flush(CompletionHandler<Integer> completionHandler) throws 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 interfaceOutput
- Throws:
IOException
-
close
public GrizzlyFuture<Integer> close(CompletionHandler<Integer> completionHandler) throws IOException
Description copied from interface:Output
Close theStreamWriter
and make sure all data was flushed.- Specified by:
close
in interfaceOutput
- Throws:
IOException
-
-