public interface OutputSink
This interface defines methods to allow an OutputStream or
Writer to allow the developer to check with the runtime
whether or not it's possible to write a certain amount of data, or if it's
not possible, to be notified when it is.
| Modifier and Type | Method and Description |
|---|---|
boolean |
canWrite() |
boolean |
canWrite(int length)
Deprecated.
the
length parameter will be ignored. Pls. use canWrite(). |
void |
notifyCanWrite(WriteHandler handler)
Instructs the
OutputSink to invoke the provided
WriteHandler when it is possible to write more bytes (or characters). |
void |
notifyCanWrite(WriteHandler handler,
int length)
Deprecated.
the
length parameter will be ignored. Pls. use notifyCanWrite(org.glassfish.grizzly.WriteHandler). |
void notifyCanWrite(WriteHandler handler)
OutputSink to invoke the provided
WriteHandler when it is possible to write more bytes (or characters).
Note that once the WriteHandler has been notified, it will not
be considered for notification again at a later point in time.handler - the WriteHandler that should be notified
when it's possible to write more data.IllegalStateException - if this method is invoked and a handler
from a previous invocation is still present (due to not having yet been
notified).@Deprecated void notifyCanWrite(WriteHandler handler, int length)
length parameter will be ignored. Pls. use notifyCanWrite(org.glassfish.grizzly.WriteHandler).OutputSink to invoke the provided
WriteHandler when it is possible to write length
bytes (or characters).
Note that once the WriteHandler has been notified, it will not
be considered for notification again at a later point in time.handler - the WriteHandler that should be notified
when it's possible to write length bytes.length - the number of bytes or characters that require writing.IllegalStateException - if this method is invoked and a handler
from a previous invocation is still present (due to not having yet been
notified).boolean canWrite()
true if a write to this OutputSink
will succeed, otherwise returns false.@Deprecated boolean canWrite(int length)
length - specifies the number of bytes (or characters) that require writingtrue if a write to this OutputSink
will succeed, otherwise returns false.Copyright © 2012-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.