public abstract class ForwardingSource extends java.lang.Object implements Source
Source which forwards calls to another. Useful for subclassing.| Constructor and Description |
|---|
ForwardingSource(Source delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this source and releases the resources held by this source.
|
Source |
delegate()
Source to which this instance is delegating. |
long |
read(Buffer sink,
long byteCount)
Removes at least 1, and up to
byteCount bytes from this and appends
them to sink. |
Timeout |
timeout()
Returns the timeout for this source.
|
java.lang.String |
toString() |
private final Source delegate
public ForwardingSource(Source delegate)
public long read(Buffer sink, long byteCount) throws java.io.IOException
SourcebyteCount bytes from this and appends
them to sink. Returns the number of bytes read, or -1 if this
source is exhausted.public Timeout timeout()
Sourcepublic void close()
throws java.io.IOException
Sourcepublic java.lang.String toString()
toString in class java.lang.Object