Top Fields Constructors Methods
org.glassfish.grizzly.streams

public abstract Class BufferedOutput

extends Object
implements Output
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.streams.Output
Known Direct Subclasses
org.glassfish.grizzly.streams.TransformerOutput, org.glassfish.grizzly.nio.transport.DefaultStreamWriter.Output
Imports
java.io.IOException, java.util.concurrent.atomic.AtomicBoolean, org.glassfish.grizzly.Buffer, .CompletionHandler, .GrizzlyFuture, org.glassfish.grizzly.impl.FutureImpl, .ReadyFutureImpl, .SafeFutureImpl, org.glassfish.grizzly.memory.CompositeBuffer

Author
oleksiys

Field Summary

Modifier and TypeField and Description
private Buffer
protected final int
protected final AtomicBoolean
private int
protected CompositeBuffer
protected static final Integer
protected static final GrizzlyFuture<Integer>

Constructor Summary

AccessConstructor and Description
public
public
BufferedOutput(int bufferSize)

Method Summary

Modifier and TypeMethod and Description
public GrizzlyFuture<Integer>
close(final CompletionHandler<Integer> completionHandler)

Implements org.glassfish.grizzly.streams.Output.close.

Close the StreamWriter and make sure all data was flushed.

public void
public GrizzlyFuture<Integer>
flush(CompletionHandler<Integer> completionHandler)

Implements org.glassfish.grizzly.streams.Output.flush.

Make sure that all data that has been written is flushed from the stream to its destination.

protected abstract GrizzlyFuture<Integer>
flush0(final Buffer buffer, final CompletionHandler<Integer> completionHandler)

public Buffer
protected int
public boolean
protected abstract Buffer
newBuffer(int size)

protected abstract void
private GrizzlyFuture<Integer>
overflow(final CompletionHandler<Integer> completionHandler)

protected abstract Buffer
reallocateBuffer(Buffer oldBuffer, int size)

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private Buffer buffer
bufferSizeback to summary
protected final int bufferSize
isClosedback to summary
protected final AtomicBoolean isClosed
lastSlicedPositionback to summary
private int lastSlicedPosition
multiBufferWindowback to summary
protected CompositeBuffer multiBufferWindow
ZEROback to summary
protected static final Integer ZERO
ZERO_READY_FUTUREback to summary
protected static final GrizzlyFuture<Integer> ZERO_READY_FUTURE

Constructor Detail

BufferedOutputback to summary
public BufferedOutput()
BufferedOutputback to summary
public BufferedOutput(int bufferSize)

Method Detail

closeback to summary
public GrizzlyFuture<Integer> close(final CompletionHandler<Integer> completionHandler) throws IOException

Implements org.glassfish.grizzly.streams.Output.close.

Doc from org.glassfish.grizzly.streams.Output.close.

Close the StreamWriter and make sure all data was flushed.

Annotations
@Override
ensureBufferCapacityback to summary
public void ensureBufferCapacity(final int size) throws IOException

Implements org.glassfish.grizzly.streams.Output.ensureBufferCapacity.

Annotations
@Override
flushback to summary
public GrizzlyFuture<Integer> flush(CompletionHandler<Integer> completionHandler) throws IOException

Implements org.glassfish.grizzly.streams.Output.flush.

Doc from org.glassfish.grizzly.streams.Output.flush.

Make sure that all data that has been written is flushed from the stream to its destination.

Annotations
@Override
flush0back to summary
protected abstract GrizzlyFuture<Integer> flush0(final Buffer buffer, final CompletionHandler<Integer> completionHandler) throws IOException
getBufferback to summary
public Buffer getBuffer()

Implements org.glassfish.grizzly.streams.Output.getBuffer.

Doc from org.glassfish.grizzly.streams.Output.getBuffer.

Return the Input's Buffer.

Annotations
@Override
getBufferedSizeback to summary
protected int getBufferedSize()
isBufferedback to summary
public boolean isBuffered()

Implements org.glassfish.grizzly.streams.Output.isBuffered.

Annotations
@Override
newBufferback to summary
protected abstract Buffer newBuffer(int size)
onClosedback to summary
protected abstract void onClosed() throws IOException
overflowback to summary
private GrizzlyFuture<Integer> overflow(final CompletionHandler<Integer> completionHandler) throws IOException
reallocateBufferback to summary
protected abstract Buffer reallocateBuffer(Buffer oldBuffer, int size)
writeback to summary
public void write(byte data) throws IOException

Implements org.glassfish.grizzly.streams.Output.write.

Annotations
@Override
writeback to summary
public void write(Buffer bufferToWrite) throws IOException

Implements org.glassfish.grizzly.streams.Output.write.

Annotations
@Override