-
- All Implemented Interfaces:
-
com.mobwith.httpmodule.Source,java.io.Closeable,java.lang.AutoCloseable
public abstract class ForwardingSource implements Source
A Source which forwards calls to another. Useful for subclassing.
-
-
Constructor Summary
Constructors Constructor Description ForwardingSource(Source delegate)
-
Method Summary
Modifier and Type Method Description final Sourcedelegate()Source to which this instance is delegating. longread(Buffer sink, long byteCount)Removes at least 1, and up to {@code byteCount}bytes from this and appendsthem to{@code sink}.Timeouttimeout()Returns the timeout for this source. voidclose()Closes this source and releases the resources held by this source. StringtoString()-
-
Constructor Detail
-
ForwardingSource
ForwardingSource(Source delegate)
-
-
Method Detail
-
read
long read(Buffer sink, long byteCount)
Removes at least 1, and up to
{@code byteCount}bytes from this and appendsthem to{@code sink}. Returns the number of bytes read, or -1 if thissource is exhausted.
-
close
void close()
Closes this source and releases the resources held by this source. It is anerror to read a closed source. It is safe to close a source more than once.
-
-
-
-