Package okio
Class ForwardingSource
- java.lang.Object
-
- okio.ForwardingSource
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Source
- Direct Known Subclasses:
HashingSource
public abstract class ForwardingSource extends java.lang.Object implements Source
ASource
which forwards calls to another. Useful for subclassing.
-
-
Constructor Summary
Constructors Constructor Description ForwardingSource(Source delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 tobyteCount
bytes from this and appends them tosink
.Timeout
timeout()
Returns the timeout for this source.java.lang.String
toString()
-
-
-
Constructor Detail
-
ForwardingSource
public ForwardingSource(Source delegate)
-
-
Method Detail
-
read
public long read(Buffer sink, long byteCount) throws java.io.IOException
Description copied from interface:Source
Removes at least 1, and up tobyteCount
bytes from this and appends them tosink
. Returns the number of bytes read, or -1 if this source is exhausted.
-
timeout
public Timeout timeout()
Description copied from interface:Source
Returns the timeout for this source.
-
close
public void close() throws java.io.IOException
Description copied from interface:Source
Closes this source and releases the resources held by this source. It is an error to read a closed source. It is safe to close a source more than once.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-