public abstract class ForwardingSource extends Object implements Source
Source which forwards calls to another. Useful for subclassing.| 构造器和说明 |
|---|
ForwardingSource(Source delegate) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
String |
toString() |
public ForwardingSource(Source delegate)
public long read(Buffer sink, long byteCount) throws IOException
SourcebyteCount bytes from this and appends them to sink. Returns the number of bytes read, or -1 if this source is exhausted.read 在接口中 SourceIOExceptionpublic void close()
throws IOException
Sourceclose 在接口中 Sourceclose 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2025. All rights reserved.