T - the element typepublic class Sink<T>
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicReference<java.io.Closeable> |
cancel
The reference to the cancel handler.
|
protected java.util.concurrent.atomic.AtomicReference<Observer<? super T>> |
observer
The reference to the observer.
|
| Constructor and Description |
|---|
Sink(Observer<? super T> observer,
java.io.Closeable cancel)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
closeSilently()
Convenience method to close this sink and suppress its exceptions.
|
Observer<T> |
getForwarder() |
protected final java.util.concurrent.atomic.AtomicReference<Observer<? super T>> observer
protected final java.util.concurrent.atomic.AtomicReference<java.io.Closeable> cancel
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionprotected void closeSilently()