java.lang.Object
org.glassfish.grizzly.streams.BufferedOutput
- All Implemented Interfaces:
Output
- Direct Known Subclasses:
DefaultStreamWriter.Output,TransformerOutput
- Author:
- oleksiys
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final AtomicBooleanprotected CompositeBufferprotected static final Integerprotected static final GrizzlyFuture<Integer> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclose(CompletionHandler<Integer> completionHandler) Close theStreamWriterand make sure all data was flushed.voidensureBufferCapacity(int size) flush(CompletionHandler<Integer> completionHandler) Make sure that all data that has been written is flushed from the stream to its destination.protected abstract GrizzlyFuture<Integer>flush0(Buffer buffer, CompletionHandler<Integer> completionHandler) Return the Input'sBuffer.protected intbooleanprotected abstract BuffernewBuffer(int size) protected abstract voidonClosed()protected abstract BufferreallocateBuffer(Buffer oldBuffer, int size) voidwrite(byte data) void
-
Field Details
-
ZERO
-
ZERO_READY_FUTURE
-
bufferSize
protected final int bufferSize -
multiBufferWindow
-
isClosed
-
-
Constructor Details
-
BufferedOutput
public BufferedOutput() -
BufferedOutput
public BufferedOutput(int bufferSize)
-
-
Method Details
-
onClosed
- Throws:
IOException
-
flush0
protected abstract GrizzlyFuture<Integer> flush0(Buffer buffer, CompletionHandler<Integer> completionHandler) throws IOException - Throws:
IOException
-
newBuffer
-
reallocateBuffer
-
write
- Specified by:
writein interfaceOutput- Throws:
IOException
-
write
- Specified by:
writein interfaceOutput- Throws:
IOException
-
isBuffered
public boolean isBuffered()- Specified by:
isBufferedin interfaceOutput
-
getBuffer
Description copied from interface:OutputReturn the Input'sBuffer. -
ensureBufferCapacity
- Specified by:
ensureBufferCapacityin interfaceOutput- Throws:
IOException
-
flush
public GrizzlyFuture<Integer> flush(CompletionHandler<Integer> completionHandler) throws IOException Description copied from interface:OutputMake sure that all data that has been written is flushed from the stream to its destination.- Specified by:
flushin interfaceOutput- Throws:
IOException
-
close
public GrizzlyFuture<Integer> close(CompletionHandler<Integer> completionHandler) throws IOException Description copied from interface:OutputClose theStreamWriterand make sure all data was flushed.- Specified by:
closein interfaceOutput- Throws:
IOException
-
getBufferedSize
protected int getBufferedSize()
-