org.glassfish.grizzly.streams
Class BufferedOutput
java.lang.Object
org.glassfish.grizzly.streams.BufferedOutput
- All Implemented Interfaces:
- Output
- Direct Known Subclasses:
- DefaultStreamWriter.Output, TransformerOutput
public abstract class BufferedOutput
- extends java.lang.Object
- implements Output
- Author:
- oleksiys
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZERO
protected static final java.lang.Integer ZERO
ZERO_READY_FUTURE
protected static final GrizzlyFuture<java.lang.Integer> ZERO_READY_FUTURE
bufferSize
protected final int bufferSize
multiBufferWindow
protected CompositeBuffer multiBufferWindow
isClosed
protected final java.util.concurrent.atomic.AtomicBoolean isClosed
BufferedOutput
public BufferedOutput()
BufferedOutput
public BufferedOutput(int bufferSize)
onClosed
protected abstract void onClosed()
throws java.io.IOException
- Throws:
java.io.IOException
flush0
protected abstract GrizzlyFuture<java.lang.Integer> flush0(Buffer buffer,
CompletionHandler<java.lang.Integer> completionHandler)
throws java.io.IOException
- Throws:
java.io.IOException
newBuffer
protected abstract Buffer newBuffer(int size)
reallocateBuffer
protected abstract Buffer reallocateBuffer(Buffer oldBuffer,
int size)
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 bufferToWrite)
throws java.io.IOException
- Specified by:
write in interface Output
- Throws:
java.io.IOException
isBuffered
public boolean isBuffered()
- Specified by:
isBuffered in interface Output
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.
ensureBufferCapacity
public void ensureBufferCapacity(int size)
throws java.io.IOException
- Specified by:
ensureBufferCapacity in interface Output
- Throws:
java.io.IOException
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
getBufferedSize
protected int getBufferedSize()
Copyright © 2011 Oracle Corpration. All Rights Reserved.