public interface AdvisingAppendable extends Appendable
Appendable that can inform the writer that a buffer limit has been reached or
exceeded.
When softLimitReached() returns true, the writer should attempt to pause
writing operations and return control to the calling thread as soon as possible. This is a
cooperative rate limiting mechanism and is best effort.
Implementers should note that if softLimitReached() returns true, they should
continue to accept writes via the .append(...) methods. Throwing an exception when in
this state is a violation of the contract.
| Modifier and Type | Method and Description |
|---|---|
AdvisingAppendable |
append(char c) |
AdvisingAppendable |
append(CharSequence csq) |
AdvisingAppendable |
append(CharSequence csq,
int start,
int end) |
boolean |
softLimitReached()
Indicates that an internal limit has been reached or exceeded and that write operations should
be suspended soon.
|
AdvisingAppendable append(CharSequence csq) throws IOException
append in interface AppendableIOExceptionAdvisingAppendable append(CharSequence csq, int start, int end) throws IOException
append in interface AppendableIOExceptionAdvisingAppendable append(char c) throws IOException
append in interface AppendableIOExceptionboolean softLimitReached()