Top Description Methods
org.glassfish.grizzly

public Interface OutputSink

Known Direct Subinterfaces
org.glassfish.grizzly.Writeable

This interface defines methods to allow an java.io.OutputStream or java.io.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.

Since
2.0

Method Summary

Modifier and TypeMethod and Description
public boolean
canWrite()

Returns: true if a write to this OutputSink will succeed, otherwise returns false.

public boolean
canWrite(final int
specifies the number of bytes (or characters) that require writing
length
)
Deprecated the length parameter will be ignored. Pls. use canWrite().

Returns: true if a write to this OutputSink will succeed, otherwise returns false.

public void
notifyCanWrite(final WriteHandler
the WriteHandler that should be notified when it's possible to write more data.
handler
)

Instructs the OutputSink to invoke the provided WriteHandler when it is possible to write more bytes (or characters).

public void
notifyCanWrite(final WriteHandler
the WriteHandler that should be notified when it's possible to write length bytes.
handler
,
final int
the number of bytes or characters that require writing.
length
)
Deprecated the length parameter will be ignored.

Instructs the OutputSink to invoke the provided WriteHandler when it is possible to write length bytes (or characters).

Method Detail

canWriteback to summary
public boolean canWrite()
Returns:boolean

true if a write to this OutputSink will succeed, otherwise returns false.

Since
2.3
canWriteback to summary
public boolean canWrite(final int length)

Deprecated

the length parameter will be ignored. Pls. use canWrite().

Parameters
length:int

specifies the number of bytes (or characters) that require writing

Returns:boolean

true if a write to this OutputSink will succeed, otherwise returns false.

Annotations
@Deprecated
notifyCanWriteback to summary
public void notifyCanWrite(final WriteHandler handler)

Instructs the 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.

Parameters
handler:WriteHandler

the WriteHandler that should be notified when it's possible to write more data.

Exceptions
IllegalStateException:
if this method is invoked and a handler from a previous invocation is still present (due to not having yet been notified).
Since
2.3
notifyCanWriteback to summary
public void notifyCanWrite(final WriteHandler handler, final int length)

Deprecated

the length parameter will be ignored. Pls. use notifyCanWrite(org.glassfish.grizzly.WriteHandler).

Instructs the 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.

Parameters
handler:WriteHandler

the WriteHandler that should be notified when it's possible to write length bytes.

length:int

the number of bytes or characters that require writing.

Annotations
@Deprecated
Exceptions
IllegalStateException:
if this method is invoked and a handler from a previous invocation is still present (due to not having yet been notified).